diff --git a/.DISABLED-hgeol b/.DISABLED-hgeol deleted file mode 100644 index b03b4cfb1..000000000 --- a/.DISABLED-hgeol +++ /dev/null @@ -1,57 +0,0 @@ -[patterns] -.hgeol = native -.hgignore = native -BUGS = native -CREDITS = native -INSTALL = native -NOTES = native -TODO = native -WhatsNew = native -**COPYING = native -**README = native -**doxyfile = native -**Doxyfile = native -**install-sh = LF -**mkinstalldirs = LF -**Makefile = LF -**Makefile.* = LF -test/automated/rwops/read = LF -**README.* = native -**.S = native -**.bmp = BIN -**.c = native -**.cc = native -**.cpp = native -**.csh = LF -**.dat = BIN -**.gdbinit = LF -build-scripts/config.guess = LF -**.h = native -**.htm = native -**.html = native -**.icns = BIN -**.in = LF -**.java = native -**.m = native -**.m4 = native -**.mk = LF -**.nib = BIN -**.pch = BIN -**.pdf = BIN -**.pl = native -**.plist = native -**.png = BIN -.indent.pro = LF -**.rc = native -**.rtf = BIN -**.sh = LF -**.sln = native -**.txt = native -**.vcp = native -**.vcproj = native -**.vcw = native -**.vcxproj = native -**.wav = BIN -**.xbm = BIN -**.xml = native -**.zip = BIN diff --git a/.hgignore b/.hgignore index c74c5047f..b6c427f82 100644 --- a/.hgignore +++ b/.hgignore @@ -1,5 +1,5 @@ syntax:glob -.svn +aclocal.m4 autom4te* config.cache config.log @@ -38,6 +38,7 @@ Release *.user *.ncb *.suo +*.sdf # for Android android-project/local.properties diff --git a/.hgtags b/.hgtags index e96564c2d..d5c2200b9 100644 --- a/.hgtags +++ b/.hgtags @@ -13,3 +13,4 @@ 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/.indent.pro b/.indent.pro deleted file mode 100644 index d95d15d95..000000000 --- a/.indent.pro +++ /dev/null @@ -1 +0,0 @@ --i4 -nut -nsc -br -ce -cdw -npcs diff --git a/Android.mk b/Android.mk index a344a5294..3230f9fea 100755 --- a/Android.mk +++ b/Android.mk @@ -12,6 +12,8 @@ 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) \ @@ -20,7 +22,7 @@ LOCAL_SRC_FILES := \ $(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/*.cpp) \ + $(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) \ diff --git a/BUGS b/BUGS.txt similarity index 84% rename from BUGS rename to BUGS.txt index 218bf3d15..7ef553875 100644 --- a/BUGS +++ b/BUGS.txt @@ -1,18 +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 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. - - + +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/CMakeLists.txt b/CMakeLists.txt index bf3f34a4c..925392ebb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,8 @@ set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}" 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") @@ -104,6 +106,12 @@ 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) @@ -190,7 +198,7 @@ dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON " 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_SYS}) +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}) @@ -203,6 +211,7 @@ dep_option(PULSEAUDIO_SHARED "Dynamically load PulseAudio support" ON "PULSEAU 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}) @@ -621,6 +630,7 @@ if(UNIX AND NOT APPLE) CheckESD() CheckARTS() CheckNAS() + CheckSNDIO() CheckFusionSound() endif(SDL_AUDIO) @@ -793,6 +803,7 @@ elseif(WINDOWS) ${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) @@ -1135,9 +1146,17 @@ set(_INSTALL_LIBS "SDL2main") if(SDL_SHARED) add_library(SDL2 SHARED ${SOURCE_FILES}) - set_target_properties(SDL2 PROPERTIES - VERSION ${SDL_VERSION} - SOVERSION ${LT_CURRENT}) + 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) @@ -1165,6 +1184,13 @@ 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 @@ -1175,4 +1201,5 @@ if(NOT WINDOWS OR CYGWIN) 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.txt similarity index 97% rename from COPYING rename to COPYING.txt index 397e7b45d..391424f79 100644 --- a/COPYING +++ b/COPYING.txt @@ -1,20 +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. - + +Simple DirectMedia Layer +Copyright (C) 1997-2013 Sam Lantinga + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as 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 4bf1f96bf..000000000 --- a/CREDITS +++ /dev/null @@ -1,70 +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* - -* 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 - -* 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 port of SDL to the iPhone and iPod Touch during the - Google Summer of Code 2008 - -* Szymon "Wilku" Wilczek for adding support for multiple mice and tablets - during the Google Summer of Code 2008 - -* Marty Leisner, Andrew, Will, Edgar Simo, Donny Viszneki, Andrea Mazzoleni, - Dmytro Bogovych, and Couriersud for helping find SDL 1.3 bugs in the great - SDL Bug Hunt of January 2009! - -* Donny Viszneki for helping fix SDL 1.3 bugs in the great SDL Bug Hunt of - January 2009! - -* Luke Benstead for OpenGL 3.0 support - -* Gaëtan de Menten for writing the PHP and SQL behind the SDL website - -* Tim Jones for the new look of the SDL website - -* Ryan Gordon for helping everybody out and keeping the dream alive. :) - -* Mattias Engdegård, for help with the Solaris port and lots of other help - -* Eric Wing, Max Horn, and Darrell Walisser for unflagging work on the Mac OS X port - -* David Carré, for the Pandora port - -* Couriersud for the DirectFB driver - -* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation - -* 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 000000000..a1c2cdcb0 --- /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/INSTALL b/INSTALL deleted file mode 100644 index 66cbfdf76..000000000 --- a/INSTALL +++ /dev/null @@ -1,27 +0,0 @@ - -To compile and install SDL: - - 0. If you have downloaded this from the website, skip to the next step. - If you have checked this out from subversion, you'll need to run - ./autogen.sh to build the configure script. - - 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 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/INSTALL.txt b/INSTALL.txt new file mode 100644 index 000000000..ce77664c9 --- /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/Makefile.in b/Makefile.in index dda6692e1..ae6293e7d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -39,7 +39,7 @@ SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@ SDLTEST_TARGET = libSDL2_test.a SDLTEST_OBJECTS = @SDLTEST_OBJECTS@ -SRC_DIST = acinclude Android.mk autogen.sh BUGS build-scripts configure configure.in COPYING CREDITS debian include INSTALL Makefile.minimal Makefile.in README* sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test TODO VisualC.html VisualC WhatsNew Xcode Xcode-iOS +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 = \ @@ -47,7 +47,7 @@ HDRS = \ SDL_assert.h \ SDL_atomic.h \ SDL_audio.h \ - SDL_bits.h \ + SDL_bits.h \ SDL_blendmode.h \ SDL_clipboard.h \ SDL_cpuinfo.h \ @@ -216,26 +216,3 @@ dist $(distfile): rpm: $(distfile) rpmbuild -ta $? - -# Run indent on the source to standardize coding style -indent: - @echo "Running indent... modified files:" - @cd $(srcdir) && \ - find . \( \ - -name '*.h' -o \ - -name '*.c' -o \ - -name '*.cc' \) \ - -print | fgrep -v ./Xcode | \ - while read file; do \ - indent "$$file" -o "$$file.indent"; \ - if cmp "$$file" "$$file.indent" >/dev/null; then \ - rm -f "$$file.indent"; \ - else \ - echo "$$file"; \ - mv -f "$$file.indent" "$$file"; \ - fi; \ - done - -# Run indent and then commit modified files -commit: indent - hg commit diff --git a/Makefile.psp b/Makefile.psp index ec137806d..8bcdcb927 100644 --- a/Makefile.psp +++ b/Makefile.psp @@ -2,7 +2,6 @@ TARGET_LIB = libSDL2.a OBJS= src/SDL.o \ src/SDL_assert.o \ src/SDL_error.o \ - src/SDL_fatal.o \ src/SDL_hints.o \ src/SDL_log.o \ src/atomic/SDL_atomic.o \ diff --git a/README-SDL.txt b/README-SDL.txt index fade0b958..0630395e5 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-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 - + +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 b/README-android.txt similarity index 95% rename from README.android rename to README-android.txt index efc3ab302..ecd31ae1b 100644 --- a/README.android +++ b/README-android.txt @@ -1,384 +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.cpp - -Your project must include some glue code that starts your main() routine: -src/main/android/SDL_android_main.cpp - - -================================================================================ - 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. - 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 icon.png files in the -drawable directories under the res directory. There are 3 directories for -different screen sizes. These can be replaced with 1 dir called 'drawable', -containing an icon file 'icon.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 +================================================================================ +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 b/README-cmake.txt similarity index 97% rename from README.cmake rename to README-cmake.txt index 7f5ac80dd..63c762b53 100644 --- a/README.cmake +++ b/README-cmake.txt @@ -1,31 +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. +================================================================================ +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 b/README-directfb.txt similarity index 96% rename from README.DirectFB rename to README-directfb.txt index 9c16a7b67..e358278ca 100644 --- a/README.DirectFB +++ b/README-directfb.txt @@ -1,106 +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 - +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 b/README-gesture.txt similarity index 98% rename from README.gesture rename to README-gesture.txt index d52c4c5a2..4d0a8d681 100644 --- a/README.gesture +++ b/README-gesture.txt @@ -1,72 +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 +=========================================================================== +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 b/README-hg.txt similarity index 97% rename from README.HG rename to README-hg.txt index 616307c6c..32fb8f99d 100644 --- a/README.HG +++ b/README-hg.txt @@ -1,23 +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. - +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 b/README-ios.txt similarity index 76% rename from README.iOS rename to README-ios.txt index f88c2a088..ee0a16d4a 100644 --- a/README.iOS +++ b/README-ios.txt @@ -1,160 +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 AppDelegate.h and AppDelegate.m files -- SDL for iPhone provides its own UIApplicationDelegate. Remove ViewController.h, ViewController.m, and ViewController.xib -- SDL for iPhone produces its user interface programmatically. -5. Make sure your project links to the following, iOS-provided frameworks: OpenGLES.framework, AudioToolbox.framework, and QuartzCore.framework -6. 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 -- 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; -} +============================================================================== +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 b/README-macosx.txt similarity index 97% rename from README.MacOSX rename to README-macosx.txt index 572a86b19..c5cc89b5b 100644 --- a/README.MacOSX +++ b/README-macosx.txt @@ -1,186 +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" +============================================================================== +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 b/README-pandora.txt similarity index 97% rename from README.pandora rename to README-pandora.txt index d522bc77a..f70ed6725 100644 --- a/README.pandora +++ b/README-pandora.txt @@ -1,16 +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 +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 b/README-platforms.txt similarity index 90% rename from README.Platforms rename to README-platforms.txt index 1e0e7a6aa..f30c45a8b 100644 --- a/README.Platforms +++ b/README-platforms.txt @@ -1,32 +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 -Windows Vista -Windows 7 -Mac OS X 10.4+ -Linux 2.6+ -iOS 3.1.3+ -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 -=============================== + +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 b/README-porting.txt similarity index 96% rename from README.Porting rename to README-porting.txt index f8540b600..bea194a4a 100644 --- a/README.Porting +++ b/README-porting.txt @@ -1,61 +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) - + +* 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 b/README-psp.txt similarity index 89% rename from README.psp rename to README-psp.txt index 469febb9a..e9e32ea5c 100644 --- a/README.psp +++ b/README-psp.txt @@ -1,17 +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 \ No newline at end of file +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 b/README-touch.txt similarity index 93% rename from README.touch rename to README-touch.txt index 9e688330f..07823c934 100644 --- a/README.touch +++ b/README-touch.txt @@ -1,84 +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 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 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_Touch 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 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) +=========================================================================== +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 b/README-wince.txt similarity index 95% rename from README.WinCE rename to README-wince.txt index 8e316d35d..eaacc4982 100644 --- a/README.WinCE +++ b/README-wince.txt @@ -1,9 +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. - + +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 b/README.txt similarity index 52% rename from README rename to README.txt index 65a07551a..681f4a33c 100644 --- a/README +++ b/README.txt @@ -1,39 +1,38 @@ - - Simple DirectMedia Layer - - (SDL) - - Version 2.0 - ---- -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 Windows, Mac OS X, Linux, FreeBSD, -NetBSD, OpenBSD, BSD/OS, Solaris, iOS, and Android. The code contains -support for other operating systems but those 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, -Go, 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". - -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) - + + 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/SDL2.spec.in b/SDL2.spec.in index ad0d57f76..2a5c47924 100644 --- a/SDL2.spec.in +++ b/SDL2.spec.in @@ -63,7 +63,7 @@ rm -rf $RPM_BUILD_ROOT %files %{__defattr} -%doc README-SDL.txt COPYING CREDITS BUGS +%doc README-SDL.txt COPYING.txt CREDITS.txt BUGS.txt %{_libdir}/lib*.%{__soext}.* %files devel diff --git a/TODO b/TODO.txt similarity index 79% rename from TODO rename to TODO.txt index 3db10b850..14c47d0eb 100644 --- a/TODO +++ b/TODO.txt @@ -1,18 +1,15 @@ -2.0 release checklist: - * http://wiki.libsdl.org/moin.cgi/Roadmap - - * See why windows are being rearranged. Is the shield window not up? - * Make sure you can create and show a fullscreen window in one step - * Write automated test case for multi-draw APIs - * Implement assertion code on iPhone - * 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) - +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 fdaeecd32..a25907bd9 100644 --- a/VisualC.html +++ b/VisualC.html @@ -4,25 +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 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. @@ -31,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 @@ -80,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.

@@ -96,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 @@ -114,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/SDL_VS2008.vcproj b/VisualC/SDL/SDL_VS2008.vcproj index 8a6c37a2c..72eb2d4c9 100644 --- a/VisualC/SDL/SDL_VS2008.vcproj +++ b/VisualC/SDL/SDL_VS2008.vcproj @@ -53,7 +53,7 @@ Optimization="0" AdditionalIncludeDirectories="..\..\include" PreprocessorDefinitions="_DEBUG;_WINDOWS" - ExceptionHandling="2" + ExceptionHandling="0" RuntimeLibrary="3" BufferSecurityCheck="false" WarningLevel="3" @@ -136,13 +136,13 @@ Optimization="0" AdditionalIncludeDirectories="..\..\include" PreprocessorDefinitions="_DEBUG;_WINDOWS" - ExceptionHandling="2" + ExceptionHandling="0" RuntimeLibrary="2" BufferSecurityCheck="false" WarningLevel="3" SuppressStartupBanner="true" Detect64BitPortabilityProblems="false" - DebugInformationFormat="3" + DebugInformationFormat="4" CompileAs="0" /> - - - - @@ -1130,6 +1124,10 @@ RelativePath="..\..\src\thread\windows\SDL_systhread.c" > + + diff --git a/VisualC/SDL/SDL_VS2010.vcxproj b/VisualC/SDL/SDL_VS2010.vcxproj index 00c15332f..4fa9111d2 100644 --- a/VisualC/SDL/SDL_VS2010.vcxproj +++ b/VisualC/SDL/SDL_VS2010.vcxproj @@ -1,463 +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 - ProgramDatabase - 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 - - - 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 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies) - true - Windows - $(DXSDK_DIR)\lib\x64 - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 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 index cdc427e66..213c10cef 100644 --- a/VisualC/SDL/SDL_VS2012.vcxproj +++ b/VisualC/SDL/SDL_VS2012.vcxproj @@ -19,7 +19,7 @@ - SDL + SDL2 {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} SDL @@ -127,7 +127,7 @@ Level3 - ProgramDatabase + EditAndContinue false @@ -166,6 +166,7 @@ true Default false + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -201,6 +202,7 @@ Level3 false + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -304,7 +306,6 @@ - @@ -408,7 +409,6 @@ - @@ -439,6 +439,7 @@ + @@ -464,4 +465,4 @@ - \ No newline at end of file +
diff --git a/VisualC/SDL_VS2008.sln b/VisualC/SDL_VS2008.sln index 91735bdab..3c6a38058 100644 --- a/VisualC/SDL_VS2008.sln +++ b/VisualC/SDL_VS2008.sln @@ -91,12 +91,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\t 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_NoSTDIO|Win32 = Release_NoSTDIO|Win32 - Release_NoSTDIO|x64 = Release_NoSTDIO|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection @@ -105,9 +110,6 @@ Global {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|x64 - {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 @@ -116,10 +118,6 @@ Global {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 @@ -127,117 +125,78 @@ Global {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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {26828762-C95D-4637-9CB1-7F0979523813}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release_NoSTDIO|x64.ActiveCfg = Release|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_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release_NoSTDIO|x64.ActiveCfg = Release|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 @@ -245,14 +204,16 @@ Global {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_NoSTDIO|Win32.ActiveCfg = Release_NoSTDIO|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_NoSTDIO|Win32.Build.0 = Release_NoSTDIO|Win32 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_NoSTDIO|x64.ActiveCfg = Release_NoSTDIO|x64 - {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_NoSTDIO|x64.Build.0 = Release_NoSTDIO|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 @@ -271,5 +232,6 @@ Global {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 index 5b95292ab..fb5d873f2 100644 --- a/VisualC/SDL_VS2010.sln +++ b/VisualC/SDL_VS2010.sln @@ -29,6 +29,40 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest 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 @@ -141,20 +175,81 @@ Global {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 - {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {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} - {26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} {26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {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 000000000..d5213da46 --- /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 index f0e01b233..3ac7b68f2 100644 --- a/VisualC/SDL_VS2012.sln +++ b/VisualC/SDL_VS2012.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL_VS2012.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2012.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain_VS2012.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +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 @@ -64,7 +64,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpowe {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLtest", "SDLtest\SDLtest_VS2012.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" +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 @@ -76,6 +76,33 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\tes {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 @@ -178,6 +205,54 @@ Global {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 @@ -193,5 +268,11 @@ Global {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 000000000..456f69982 --- /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_VS2008.vcproj b/VisualC/SDLmain/SDLmain_VS2008.vcproj index 4e1c1e02c..9e43c5c3a 100644 --- a/VisualC/SDLmain/SDLmain_VS2008.vcproj +++ b/VisualC/SDLmain/SDLmain_VS2008.vcproj @@ -49,10 +49,12 @@ AdditionalIncludeDirectories="..\..\include,..\..\include\SDL" PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" StringPooling="true" + ExceptionHandling="0" RuntimeLibrary="2" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" + DebugInformationFormat="1" CompileAs="0" /> Level3 true Default + false + OldStyle true @@ -106,6 +108,7 @@ Level3 true Default + OldStyle true @@ -124,6 +127,7 @@ true OldStyle Default + false true diff --git a/VisualC/SDLmain/SDLmain_VS2012.vcxproj b/VisualC/SDLmain/SDLmain_VS2012.vcxproj index d95409bca..d44ea95c1 100644 --- a/VisualC/SDLmain/SDLmain_VS2012.vcxproj +++ b/VisualC/SDLmain/SDLmain_VS2012.vcxproj @@ -1,162 +1,168 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDLmain - {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 - - - true - - - - - X64 - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - true - - - - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - - - true - - - - - X64 - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - - - true - - - - - - - - + + + + + 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 index 99e55e983..4cd7e0003 100644 --- a/VisualC/SDLtest/SDLtest_VS2008.vcproj +++ b/VisualC/SDLtest/SDLtest_VS2008.vcproj @@ -49,10 +49,12 @@ AdditionalIncludeDirectories="..\..\include,..\..\include\SDL" PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" StringPooling="true" + ExceptionHandling="0" RuntimeLibrary="2" EnableFunctionLevelLinking="true" WarningLevel="3" SuppressStartupBanner="true" + DebugInformationFormat="1" CompileAs="0" /> Level3 true Default + false + OldStyle true @@ -106,6 +108,7 @@ Level3 true Default + OldStyle true @@ -124,6 +127,7 @@ true OldStyle Default + false true diff --git a/VisualC/SDLtest/SDLtest_VS2012.vcxproj b/VisualC/SDLtest/SDLtest_VS2012.vcxproj index 762f2b5fe..a0d78c6b5 100644 --- a/VisualC/SDLtest/SDLtest_VS2012.vcxproj +++ b/VisualC/SDLtest/SDLtest_VS2012.vcxproj @@ -1,190 +1,196 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - SDLtest - {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 - - - true - - - - - X64 - - - OnlyExplicitInline - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - true - - - - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - - - true - - - - - X64 - - - Disabled - ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - OldStyle - Default - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + 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/tests/automated/automated_VS2008.vcproj b/VisualC/tests/automated/automated_VS2008.vcproj deleted file mode 100644 index 97eb4c71e..000000000 --- a/VisualC/tests/automated/automated_VS2008.vcproj +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/automated/automated_VS2010.vcxproj b/VisualC/tests/automated/automated_VS2010.vcxproj deleted file mode 100644 index de7fa16fc..000000000 --- a/VisualC/tests/automated/automated_VS2010.vcxproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - automated - {DDD710DB-EC7B-4CCB-BD75-535D401A2FE0} - automated - 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 - - - - - Disabled - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - true - Windows - - - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.d.." "$(TargetDir)\SDL2.d.." - - - Copy SDL - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - MachineX86 - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/automated/automated_VS2012.vcxproj b/VisualC/tests/automated/automated_VS2012.vcxproj deleted file mode 100644 index 5854da931..000000000 --- a/VisualC/tests/automated/automated_VS2012.vcxproj +++ /dev/null @@ -1,193 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - automated - {DDD710DB-EC7B-4CCB-BD75-535D401A2FE0} - automated - 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 - - - - - Disabled - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - true - Windows - - - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" - - - Copy SDL - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - MachineX86 - - - - - MaxSpeed - true - $(SolutionDir)..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - true - Windows - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj b/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj index 954e97eb5..10ac85e90 100644 --- a/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj +++ b/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj @@ -109,7 +109,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -143,7 +143,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -178,7 +178,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -212,7 +212,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -222,8 +222,8 @@ - - + + diff --git a/VisualC/tests/graywin/graywin_VS2008.vcproj b/VisualC/tests/graywin/graywin_VS2008.vcproj deleted file mode 100644 index 97b4ccc2a..000000000 --- a/VisualC/tests/graywin/graywin_VS2008.vcproj +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/loopwave/loopwave_VS2012.vcxproj b/VisualC/tests/loopwave/loopwave_VS2012.vcxproj index 0919528a3..0a648593e 100644 --- a/VisualC/tests/loopwave/loopwave_VS2012.vcxproj +++ b/VisualC/tests/loopwave/loopwave_VS2012.vcxproj @@ -109,7 +109,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -143,7 +143,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -178,7 +178,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -212,7 +212,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -222,8 +222,8 @@ - - + + diff --git a/VisualC/tests/testalpha/testalpha_VS2008.vcproj b/VisualC/tests/testalpha/testalpha_VS2008.vcproj deleted file mode 100644 index af8314b1b..000000000 --- a/VisualC/tests/testalpha/testalpha_VS2008.vcproj +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testatomic/testatomic_VS2010.vcxproj b/VisualC/tests/testatomic/testatomic_VS2010.vcxproj index bac44109f..3b7c7e100 100644 --- a/VisualC/tests/testatomic/testatomic_VS2010.vcxproj +++ b/VisualC/tests/testatomic/testatomic_VS2010.vcxproj @@ -1,22 +1,34 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + testatomic - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} + {2271060E-98B4-4596-8172-A041E4B2EC7A} testatomic - + + Application + false + + Application false @@ -24,26 +36,45 @@ Application false - + + Application + false + MultiByte + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - .\Debug\ - .\Debug\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ true - .\Release\ - .\Release\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ false + false @@ -51,19 +82,14 @@ true true Win32 - .\Debug/testatomic.tlb Disabled ..\..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL - .\Debug/testatomic.pch - .\Debug/ - .\Debug/ - .\Debug/ Level3 true EditAndContinue @@ -74,13 +100,50 @@ 0x0409 - /MACHINE:I386 %(AdditionalOptions) - .\Debug/testatomic.exe true true - .\Debug/testatomic.pdb 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 + @@ -88,7 +151,6 @@ true true Win32 - .\Release/testatomic.tlb OnlyExplicitInline @@ -99,10 +161,6 @@ true - .\Release/testatomic.pch - .\Release/ - .\Release/ - .\Release/ Level3 true Default @@ -112,23 +170,62 @@ 0x0409 - /MACHINE:I386 %(AdditionalOptions) - .\Release/testatomic.exe true - .\Release/testatomic.pdb 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/testatomic.pch - - + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + - + \ No newline at end of file diff --git a/VisualC/tests/testalpha/testalpha_VS2010.vcxproj b/VisualC/tests/testatomic/testatomic_VS2012.vcxproj similarity index 89% rename from VisualC/tests/testalpha/testalpha_VS2010.vcxproj rename to VisualC/tests/testatomic/testatomic_VS2012.vcxproj index 2e348c00b..8e908f01b 100644 --- a/VisualC/tests/testalpha/testalpha_VS2010.vcxproj +++ b/VisualC/tests/testatomic/testatomic_VS2012.vcxproj @@ -19,27 +19,31 @@ - testalpha - testalpha - {7814D54B-65D3-4677-AD77-E0B980B4FA2D} + testatomic + {2271060E-98B4-4596-8172-A041E4B2EC7A} + testatomic Application false + v110 Application false + v110 Application false + v110 Application false MultiByte + v110 @@ -105,11 +109,10 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" - Copy SDL and data files + Copy SDL @@ -140,11 +143,10 @@ copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" - Copy SDL and data files + Copy SDL @@ -176,11 +178,10 @@ copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" - Copy SDL and data files + Copy SDL @@ -211,21 +212,24 @@ copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" - Copy SDL and data files + Copy SDL - - + - + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + - +
\ No newline at end of file diff --git a/VisualC/tests/testvidinfo/testvidinfo_VS2008.vcproj b/VisualC/tests/testautomation/testautomation_VS2008.vcproj old mode 100644 new mode 100755 similarity index 65% rename from VisualC/tests/testvidinfo/testvidinfo_VS2008.vcproj rename to VisualC/tests/testautomation/testautomation_VS2008.vcproj index b71b54fc4..5b5ffa66f --- a/VisualC/tests/testvidinfo/testvidinfo_VS2008.vcproj +++ b/VisualC/tests/testautomation/testautomation_VS2008.vcproj @@ -2,9 +2,9 @@ @@ -16,9 +16,9 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testautomation/testautomation_vs2010.vcxproj b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj index 66faf965a..3c4fe9d9f 100644 --- a/VisualC/tests/testautomation/testautomation_vs2010.vcxproj +++ b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj @@ -1,4 +1,4 @@ - + @@ -179,19 +179,21 @@ + + + + - - - - - - + + + + @@ -210,4 +212,4 @@ - \ No newline at end of file +
diff --git a/VisualC/tests/testautomation/testautomation_vs2012.vcxproj b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj index 6927468f6..a026096bc 100644 --- a/VisualC/tests/testautomation/testautomation_vs2012.vcxproj +++ b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj @@ -1,4 +1,4 @@ - + @@ -97,7 +97,7 @@ MachineX86 - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -120,7 +120,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -147,7 +147,7 @@ MachineX86 - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -173,7 +173,7 @@ true - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -183,27 +183,29 @@ - + + + + + - - - - - - + + + + - - - + + + diff --git a/VisualC/tests/testcursor/testcursor_VS2008.vcproj b/VisualC/tests/testcursor/testcursor_VS2008.vcproj deleted file mode 100755 index 6f2c89733..000000000 --- a/VisualC/tests/testcursor/testcursor_VS2008.vcproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testcursor/testcursor_VS2010.vcxproj b/VisualC/tests/testcursor/testcursor_VS2010.vcxproj deleted file mode 100755 index 9c3b45464..000000000 --- a/VisualC/tests/testcursor/testcursor_VS2010.vcxproj +++ /dev/null @@ -1,247 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testcursor - testcursor - {20839E82-6F23-429D-91D7-8A2601BC7EA8} - - - - 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 - .\Debug/testcursor.bsc - - - 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 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - - - true - .\Debug/testcursor.bsc - - - 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 - Win32 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level3 - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - true - .\Release/testcursor.bsc - - - 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 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level3 - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - true - .\Release/testcursor.bsc - - - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" - - - Copy SDL and data files - - - - - - - - - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - diff --git a/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj b/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj index c1003f21f..e95358feb 100644 --- a/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj +++ b/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj @@ -109,7 +109,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -143,7 +143,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -178,7 +178,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -212,7 +212,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -222,9 +222,9 @@ - - - + + + diff --git a/VisualC/tests/testfile/testfile_VS2012.vcxproj b/VisualC/tests/testfile/testfile_VS2012.vcxproj index 9033fc77a..dc9f82827 100644 --- a/VisualC/tests/testfile/testfile_VS2012.vcxproj +++ b/VisualC/tests/testfile/testfile_VS2012.vcxproj @@ -109,7 +109,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -143,7 +143,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -178,7 +178,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -212,15 +212,15 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL - - + + diff --git a/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj b/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj index 19049dc26..e2d7b6b05 100644 --- a/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj +++ b/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj @@ -105,7 +105,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -139,7 +139,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -174,7 +174,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -208,15 +208,15 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL - - + + diff --git a/VisualC/tests/testvidinfo/testvidinfo_VS2010.vcxproj b/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj similarity index 93% rename from VisualC/tests/testvidinfo/testvidinfo_VS2010.vcxproj rename to VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj index 574606b57..c832c5937 100644 --- a/VisualC/tests/testvidinfo/testvidinfo_VS2010.vcxproj +++ b/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj @@ -19,27 +19,31 @@ - testvidinfo - testvidinfo - {575FD095-EDAB-4BD4-B733-CD4A874F6FB0} + testgamecontroller + testgamecontroller + {55812185-D13C-4022-9C81-32E0F4A08336} Application false + v110 Application false MultiByte + v110 Application false + v110 Application false + v110 @@ -139,7 +143,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL.dl"l + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -215,13 +219,13 @@ - - + + - + - +
\ No newline at end of file diff --git a/VisualC/tests/testgamma/testgamma_VS2008.vcproj b/VisualC/tests/testgamma/testgamma_VS2008.vcproj deleted file mode 100644 index c274acce5..000000000 --- a/VisualC/tests/testgamma/testgamma_VS2008.vcproj +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testgesture/testgesture_VS2010.vcxproj b/VisualC/tests/testgesture/testgesture_VS2010.vcxproj index 4dc2be9ef..63adbf085 100644 --- a/VisualC/tests/testgesture/testgesture_VS2010.vcxproj +++ b/VisualC/tests/testgesture/testgesture_VS2010.vcxproj @@ -1,134 +1,227 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - testgesture - {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} - testgesture - - - - Application - false - - - Application - false - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - .\Debug\ - .\Debug\ - true - .\Release\ - .\Release\ - false - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/testgesture.tlb - - - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL - - - .\Debug/testgesture.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /MACHINE:I386 %(AdditionalOptions) - .\Debug/testgesture.exe - true - true - .\Debug/testgesture.pdb - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/testgesture.tlb - - - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - .\Release/testgesture.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /MACHINE:I386 %(AdditionalOptions) - .\Release/testgesture.exe - true - .\Release/testgesture.pdb - Windows - - - - - - - - - .\Debug/testgesture.pch - - - - - - + + + + + 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/testwm/testwm_VS2010.vcxproj b/VisualC/tests/testgesture/testgesture_VS2012.vcxproj similarity index 94% rename from VisualC/tests/testwm/testwm_VS2010.vcxproj rename to VisualC/tests/testgesture/testgesture_VS2012.vcxproj index b4d231650..ef7182011 100644 --- a/VisualC/tests/testwm/testwm_VS2010.vcxproj +++ b/VisualC/tests/testgesture/testgesture_VS2012.vcxproj @@ -19,39 +19,35 @@ - testwm - testwm - {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB} + testgesture + testgesture + {55812185-D13C-4022-9C81-32E0F4A08996} - - Application - false - - - Application - false - Application false + v110 Application false MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 - - - - - - - - @@ -60,91 +56,30 @@ + + + + + + + + <_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 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true - - - _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) @@ -214,14 +149,83 @@ 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_VS2008.vcproj b/VisualC/tests/testgl/testgl_VS2008.vcproj deleted file mode 100644 index 6d384a148..000000000 --- a/VisualC/tests/testgl/testgl_VS2008.vcproj +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testgl/testgl_VS2010.vcxproj b/VisualC/tests/testgl/testgl_VS2010.vcxproj deleted file mode 100644 index 1665eb86e..000000000 --- a/VisualC/tests/testgl/testgl_VS2010.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testgl - testgl - {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D} - - - - 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 - - - - - - - - - - - - - diff --git a/VisualC/tests/testgl2/testgl2_VS2012.vcxproj b/VisualC/tests/testgl2/testgl2_VS2012.vcxproj index 4f4aa9552..d02101fe7 100644 --- a/VisualC/tests/testgl2/testgl2_VS2012.vcxproj +++ b/VisualC/tests/testgl2/testgl2_VS2012.vcxproj @@ -110,7 +110,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -145,7 +145,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -181,7 +181,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -216,7 +216,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -226,9 +226,9 @@ - - - + + + diff --git a/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj b/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj index 56cff76c1..41c98e425 100644 --- a/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj +++ b/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj @@ -1,227 +1,227 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testjoystick - testjoystick - {55812185-D13C-4022-9C81-32E0F4A08304} - - - - 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 - - - - - - - - - - - - - + + + + + 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/graywin/graywin_VS2010.vcxproj b/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj similarity index 93% rename from VisualC/tests/graywin/graywin_VS2010.vcxproj rename to VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj index 6688dc088..9730432dd 100644 --- a/VisualC/tests/graywin/graywin_VS2010.vcxproj +++ b/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj @@ -19,39 +19,35 @@ - graywin - graywin - {0BCCA0BF-073E-439E-BCE0-C9353C177487} + testjoystick + testjoystick + {55812185-D13C-4022-9C81-32E0F4A08BCC} - - Application - false - - - Application - false - Application false + v110 Application false MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 - - - - - - - - @@ -60,91 +56,30 @@ + + + + + + + + <_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 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true - - - _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) @@ -214,14 +149,83 @@ 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/testoverlay/testoverlay_VS2008.vcproj b/VisualC/tests/testoverlay/testoverlay_VS2008.vcproj deleted file mode 100644 index 7752c1f6e..000000000 --- a/VisualC/tests/testoverlay/testoverlay_VS2008.vcproj +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj b/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj index 812c4ecc9..86a73edb9 100644 --- a/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj +++ b/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj @@ -21,7 +21,7 @@ testoverlay2 testoverlay2 - {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} + {55812185-D13C-4022-9C81-32E0F4A08AAD} @@ -105,7 +105,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" @@ -140,11 +140,11 @@ copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" - Copy SDL and data files + Copy SDL @@ -176,7 +176,7 @@ copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" @@ -211,17 +211,16 @@ copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" Windows - - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" - copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" Copy SDL and data files - - + + @@ -229,4 +228,4 @@ copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" - + \ No newline at end of file diff --git a/VisualC/tests/testgamma/testgamma_VS2010.vcxproj b/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj similarity index 90% rename from VisualC/tests/testgamma/testgamma_VS2010.vcxproj rename to VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj index db3c4e13c..d51d495e9 100644 --- a/VisualC/tests/testgamma/testgamma_VS2010.vcxproj +++ b/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj @@ -19,39 +19,35 @@ - testgamma - testgamma - {D974A0DF-3E2E-445C-A2EB-E899E9B582CB} + testoverlay2 + testoverlay2 + {55812185-D13C-4022-9C81-32E0F4A08AAD} - - Application - false - - - Application - false - Application false + v110 Application false MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 - - - - - - - - @@ -60,93 +56,30 @@ + + + + + + + + <_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 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true - - - _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\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\sample.bmp" "$(TargetDir)\sample.bmp" - - - Copy SDL and data files - - NDEBUG;%(PreprocessorDefinitions) @@ -177,10 +110,10 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" - Copy SDL and data files + Copy SDL @@ -212,20 +145,91 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" - Copy SDL and data files + 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/testplatform/testplatform_VS2012.vcxproj b/VisualC/tests/testplatform/testplatform_VS2012.vcxproj index d4f0475e9..8885fdf71 100644 --- a/VisualC/tests/testplatform/testplatform_VS2012.vcxproj +++ b/VisualC/tests/testplatform/testplatform_VS2012.vcxproj @@ -110,7 +110,7 @@ true - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -144,7 +144,7 @@ true - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -186,7 +186,7 @@ true - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -221,15 +221,15 @@ true - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL - - + + diff --git a/VisualC/tests/testpower/testpower_VS2012.vcxproj b/VisualC/tests/testpower/testpower_VS2012.vcxproj index 3983a7bbb..60c8981c6 100644 --- a/VisualC/tests/testpower/testpower_VS2012.vcxproj +++ b/VisualC/tests/testpower/testpower_VS2012.vcxproj @@ -109,7 +109,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -143,7 +143,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -178,7 +178,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -212,15 +212,15 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL - - + + diff --git a/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj b/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj index d7772e436..133366f5c 100644 --- a/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj +++ b/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj @@ -1,4 +1,4 @@ - + @@ -20,10 +20,18 @@ testrendertarget + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} testrendertarget - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} + + Application + false + + + Application + false + Application false @@ -33,25 +41,9 @@ false MultiByte - - Application - false - - - Application - false - - + - - - - - - - - @@ -60,95 +52,30 @@ + + + + + + + + <_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 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false - - - 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 - - _DEBUG;%(PreprocessorDefinitions) @@ -180,7 +107,7 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" 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 "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" Copy SDL and data files @@ -216,20 +143,99 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" 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 "$(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/testwin/testwin_VS2010.vcxproj b/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj similarity index 85% rename from VisualC/tests/testwin/testwin_VS2010.vcxproj rename to VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj index 679c322ea..b85c066c2 100644 --- a/VisualC/tests/testwin/testwin_VS2010.vcxproj +++ b/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj @@ -1,4 +1,4 @@ - + @@ -19,29 +19,32 @@ - testwin - testwin - {0FFD1A21-11DB-492C-A989-E4F195B0C441} + testrendertarget + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} + testrendertarget - + Application false + v110 Application false + v110 Application false + v110 Application false - MultiByte + v110 - + @@ -106,7 +109,8 @@ copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" Copy SDL and data files @@ -141,7 +145,8 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" Copy SDL and data files @@ -177,7 +182,8 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" Copy SDL and data files @@ -211,22 +217,29 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" Windows - - copy $(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll $(TargetDir)\SDL2.dll - copy $(SolutionDir)\..\test\sample.bmp $(TargetDir)\sample.bmp + 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_VS2010.vcxproj b/VisualC/tests/testscale/testscale_VS2010.vcxproj index 0c3d5c032..6753c1cd2 100644 --- a/VisualC/tests/testscale/testscale_VS2010.vcxproj +++ b/VisualC/tests/testscale/testscale_VS2010.vcxproj @@ -1,4 +1,4 @@ - + @@ -20,10 +20,18 @@ testscale + {E7A6C41C-E059-4C9C-8CCC-73586A540B62} testscale - {40FB7794-D3C3-4CFE-BCF4-A80C96635682} + + Application + false + + + Application + false + Application false @@ -33,25 +41,9 @@ false MultiByte - - Application - false - - - Application - false - - + - - - - - - - - @@ -60,95 +52,30 @@ + + + + + + + + <_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 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false - - - 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 - - _DEBUG;%(PreprocessorDefinitions) @@ -180,7 +107,7 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" 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 "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" Copy SDL and data files @@ -216,20 +143,99 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" 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 "$(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/testoverlay/testoverlay_VS2010.vcxproj b/VisualC/tests/testscale/testscale_VS2012.vcxproj similarity index 86% rename from VisualC/tests/testoverlay/testoverlay_VS2010.vcxproj rename to VisualC/tests/testscale/testscale_VS2012.vcxproj index 9c3d75be1..1419804b2 100644 --- a/VisualC/tests/testoverlay/testoverlay_VS2010.vcxproj +++ b/VisualC/tests/testscale/testscale_VS2012.vcxproj @@ -1,4 +1,4 @@ - + @@ -19,39 +19,35 @@ - testoverlay - testoverlay - {9E320A14-B443-4DD7-8725-B7020DCFF730} + testscale + {E7A6C41C-E059-4C9C-8CCC-73586A540B62} + testscale + + Application + false + v110 + + + Application + false + v110 + Application false + v110 Application false MultiByte + v110 - - Application - false - - - Application - false - - + - - - - - - - - @@ -60,29 +56,109 @@ + + + + + + + + <_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 + $(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 - .\Release/testoverlay.tlb OnlyExplicitInline @@ -107,7 +183,8 @@ copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" Copy SDL and data files @@ -142,91 +219,28 @@ copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" -copy $(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.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\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\sample.bmp" "$(TargetDir)\sample.bm"p +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_VS2012.vcxproj b/VisualC/tests/testshape/testshape_VS2012.vcxproj index 847dfa50a..b7c4e5e1c 100644 --- a/VisualC/tests/testshape/testshape_VS2012.vcxproj +++ b/VisualC/tests/testshape/testshape_VS2012.vcxproj @@ -109,7 +109,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -143,7 +143,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -178,7 +178,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL @@ -212,15 +212,15 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" Copy SDL - - + + diff --git a/VisualC/tests/testsprite/testsprite_VS2008.vcproj b/VisualC/tests/testsprite/testsprite_VS2008.vcproj deleted file mode 100644 index 256d7125e..000000000 --- a/VisualC/tests/testsprite/testsprite_VS2008.vcproj +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testsprite/testsprite_VS2010.vcxproj b/VisualC/tests/testsprite/testsprite_VS2010.vcxproj deleted file mode 100644 index c1459bfc0..000000000 --- a/VisualC/tests/testsprite/testsprite_VS2010.vcxproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testsprite - testsprite - {5D0930C0-7C91-4ECE-9014-7B7DDE9502E5} - - - - 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 - - - - - - - - - - - - - diff --git a/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj b/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj index a633da983..c2ac6e0e3 100644 --- a/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj +++ b/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj @@ -109,7 +109,7 @@ Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" @@ -144,7 +144,7 @@ copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" @@ -180,7 +180,7 @@ copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" @@ -215,7 +215,7 @@ copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" Windows - copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL.dll" "$(TargetDir)\SDL.dll" + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" @@ -226,9 +226,9 @@ copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" - - - + + + diff --git a/VisualC/tests/testwin/testwin_VS2008.vcproj b/VisualC/tests/testwin/testwin_VS2008.vcproj deleted file mode 100644 index d1e760685..000000000 --- a/VisualC/tests/testwin/testwin_VS2008.vcproj +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testwm/testwm_VS2008.vcproj b/VisualC/tests/testwm/testwm_VS2008.vcproj deleted file mode 100644 index de3c6034a..000000000 --- a/VisualC/tests/testwm/testwm_VS2008.vcproj +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WhatsNew b/WhatsNew.txt similarity index 95% rename from WhatsNew rename to WhatsNew.txt index a54ab0abb..c3784deab 100644 --- a/WhatsNew +++ b/WhatsNew.txt @@ -1,3 +1,3 @@ - -This is a list of API changes in SDL's version history. - + +This is a list of API changes in SDL's version history. + diff --git a/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj b/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj index 29ebd4dde..e3eaecdae 100755 --- a/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj +++ b/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj @@ -154,13 +154,6 @@ remoteGlobalIDString = FD6526620DE8FCCB002AD96B; remoteInfo = libSDL; }; - 04AB757011E563D200BE9753 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 006E982211955059001DE610; - remoteInfo = testsdl; - }; FD1B489D0E313154007AB34E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; @@ -374,7 +367,6 @@ isa = PBXGroup; children = ( FD1B489E0E313154007AB34E /* libSDL2.a */, - 04AB757111E563D200BE9753 /* testsdl.app */, ); name = Products; sourceTree = ""; @@ -597,13 +589,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 04AB757111E563D200BE9753 /* testsdl.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = testsdl.app; - remoteRef = 04AB757011E563D200BE9753 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; FD1B489E0E313154007AB34E /* libSDL2.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; diff --git a/Xcode-iOS/Demos/Info.plist b/Xcode-iOS/Demos/Info.plist index c0f1179d3..0398f008b 100644 --- a/Xcode-iOS/Demos/Info.plist +++ b/Xcode-iOS/Demos/Info.plist @@ -24,5 +24,7 @@ 1.0 NSMainNibFile + UISupportedInterfaceOrientations + diff --git a/Xcode-iOS/Demos/src/accelerometer.c b/Xcode-iOS/Demos/src/accelerometer.c index 339febc11..115de627f 100644 --- a/Xcode-iOS/Demos/src/accelerometer.c +++ b/Xcode-iOS/Demos/src/accelerometer.c @@ -1,7 +1,7 @@ /* - * accelerometer.c - * written by Holmes Futrell - * use however you want + * accelerometer.c + * written by Holmes Futrell + * use however you want */ #include "SDL.h" @@ -13,7 +13,7 @@ #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 */ +/* 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 @@ -48,7 +48,7 @@ render(SDL_Renderer *renderer) #define SINT16_MAX ((float)(0x7FFF)) /* update velocity from accelerometer - the factor SDL_IPHONE_MAX_G_FORCE / SINT16_MAX converts between + 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 += @@ -159,7 +159,7 @@ main(int argc, char *argv[]) { SDL_Window *window; /* main window */ - SDL_Renderer *renderer; + 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 */ @@ -172,7 +172,7 @@ main(int argc, char *argv[]) /* create main window and renderer */ window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | + SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); renderer = SDL_CreateRenderer(window, 0, 0); diff --git a/Xcode-iOS/Demos/src/common.c b/Xcode-iOS/Demos/src/common.c index fd3a176db..b2d963456 100644 --- a/Xcode-iOS/Demos/src/common.c +++ b/Xcode-iOS/Demos/src/common.c @@ -1,7 +1,7 @@ /* - * common.c - * written by Holmes Futrell - * use however you want + * common.c + * written by Holmes Futrell + * use however you want */ #include "common.h" @@ -9,8 +9,8 @@ #include /* - Produces a random int x, min <= x <= max - following a uniform distribution + Produces a random int x, min <= x <= max + following a uniform distribution */ int randomInt(int min, int max) @@ -19,8 +19,8 @@ randomInt(int min, int max) } /* - Produces a random float x, min <= x <= max - following a uniform distribution + Produces a random float x, min <= x <= max + following a uniform distribution */ float randomFloat(float min, float max) diff --git a/Xcode-iOS/Demos/src/common.h b/Xcode-iOS/Demos/src/common.h index 9aa01a23e..3e0d94ecf 100644 --- a/Xcode-iOS/Demos/src/common.h +++ b/Xcode-iOS/Demos/src/common.h @@ -1,7 +1,7 @@ /* - * common.h - * written by Holmes Futrell - * use however you want + * common.h + * written by Holmes Futrell + * use however you want */ #define SCREEN_WIDTH 320 diff --git a/Xcode-iOS/Demos/src/fireworks.c b/Xcode-iOS/Demos/src/fireworks.c index fa39abff5..b2a4d095d 100644 --- a/Xcode-iOS/Demos/src/fireworks.c +++ b/Xcode-iOS/Demos/src/fireworks.c @@ -1,7 +1,7 @@ /* - * fireworks.c - * written by Holmes Futrell - * use however you want + * fireworks.c + * written by Holmes Futrell + * use however you want */ #include "SDL.h" @@ -17,11 +17,11 @@ 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 +/* + 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 { @@ -30,7 +30,7 @@ enum particleType dust }; /* - struct particle is used to describe each particle displayed on screen + struct particle is used to describe each particle displayed on screen */ struct particle { @@ -57,8 +57,8 @@ 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 +/* helper function (used in texture loading) + returns next power of two greater than or equal to x */ int nextPowerOfTwo(int x) @@ -70,8 +70,8 @@ nextPowerOfTwo(int x) return val; } -/* - steps each active particle by timestep MILLESECONDS_PER_FRAME +/* + steps each active particle by timestep MILLESECONDS_PER_FRAME */ void stepParticles(void) @@ -145,13 +145,13 @@ stepParticles(void) curr++; } /* the number of active particles is computed as the difference between - old number of active particles, where slot points, and the + 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 + This draws all the particles shown on screen */ void drawParticles() @@ -177,7 +177,7 @@ drawParticles() } /* - This causes an emitter to explode in a circular bloom of dust particles + This causes an emitter to explode in a circular bloom of dust particles */ void explodeEmitter(struct particle *emitter) @@ -219,7 +219,7 @@ explodeEmitter(struct particle *emitter) } /* - This spawns a trail particle from an emitter + This spawns a trail particle from an emitter */ void spawnTrailFromEmitter(struct particle *emitter) @@ -254,7 +254,7 @@ spawnTrailFromEmitter(struct particle *emitter) } /* - spawns a new emitter particle at the bottom of the screen + spawns a new emitter particle at the bottom of the screen destined for the point (x,y). */ void @@ -313,7 +313,7 @@ initializeParticles(void) } /* - loads the particle texture + loads the particle texture */ void initializeTexture() @@ -375,7 +375,7 @@ main(int argc, char *argv[]) } /* seed the random number generator */ srand(time(NULL)); - /* + /* request some OpenGL parameters that may speed drawing */ @@ -389,7 +389,7 @@ main(int argc, char *argv[]) /* create main window and renderer */ window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | + SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); context = SDL_GL_CreateContext(window); diff --git a/Xcode-iOS/Demos/src/happy.c b/Xcode-iOS/Demos/src/happy.c index c1731b879..ce661d958 100644 --- a/Xcode-iOS/Demos/src/happy.c +++ b/Xcode-iOS/Demos/src/happy.c @@ -1,7 +1,7 @@ /* - * happy.c - * written by Holmes Futrell - * use however you want + * happy.c + * written by Holmes Futrell + * use however you want */ #include "SDL.h" @@ -20,8 +20,8 @@ static struct } faces[NUM_HAPPY_FACES]; /* - Sets initial positions and velocities of happyfaces - units of velocity are pixels per millesecond + Sets initial positions and velocities of happyfaces + units of velocity are pixels per millesecond */ void initializeHappyFaces() @@ -94,7 +94,7 @@ render(SDL_Renderer *renderer) } /* - loads the happyface graphic into a texture + loads the happyface graphic into a texture */ void initializeTexture(SDL_Renderer *renderer) @@ -125,7 +125,7 @@ main(int argc, char *argv[]) { SDL_Window *window; - SDL_Renderer *renderer; + SDL_Renderer *renderer; Uint32 startFrame; Uint32 endFrame; Uint32 delay; @@ -136,7 +136,7 @@ main(int argc, char *argv[]) fatalError("Could not initialize SDL"); } window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | + SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); renderer = SDL_CreateRenderer(window, -1, 0); diff --git a/Xcode-iOS/Demos/src/keyboard.c b/Xcode-iOS/Demos/src/keyboard.c index 3e2bc5459..fd903ff86 100644 --- a/Xcode-iOS/Demos/src/keyboard.c +++ b/Xcode-iOS/Demos/src/keyboard.c @@ -1,7 +1,7 @@ /* - * keyboard.c - * written by Holmes Futrell - * use however you want + * keyboard.c + * written by Holmes Futrell + * use however you want */ #import "SDL.h" @@ -97,14 +97,14 @@ fontMapping map[TABLE_SIZE] = { }; /* - 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 + 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) @@ -125,8 +125,8 @@ keyToIndex(SDL_Keysym key) return index; } -/* - This function returns and x,y position for a given character number. +/* + This function returns and x,y position for a given character number. It is used for positioning each character of text */ void @@ -168,8 +168,7 @@ 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.unused); + SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a); SDL_RenderFillRect(renderer, &rect); } @@ -248,8 +247,7 @@ main(int argc, char *argv[]) loadFont(); /* draw the background, we'll just paint over it */ - SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, - bg_color.unused); + SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a); SDL_RenderFillRect(renderer, NULL); SDL_RenderPresent(renderer); diff --git a/Xcode-iOS/Demos/src/mixer.c b/Xcode-iOS/Demos/src/mixer.c index 893361f9a..bd0cfb1df 100644 --- a/Xcode-iOS/Demos/src/mixer.c +++ b/Xcode-iOS/Demos/src/mixer.c @@ -1,7 +1,7 @@ /* - * mixer.c - * written by Holmes Futrell - * use however you want + * mixer.c + * written by Holmes Futrell + * use however you want */ #import "SDL.h" @@ -100,7 +100,7 @@ loadSound(const char *file, struct sound *s) 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 */ @@ -171,7 +171,7 @@ render(SDL_Renderer *renderer) 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.unused); + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a); SDL_RenderFillRect(renderer, &buttons[i].rect); } /* update the screen */ @@ -179,8 +179,8 @@ render(SDL_Renderer *renderer) } /* - finds a sound channel in the mixer for a sound - and sets it up to start playing + finds a sound channel in the mixer for a sound + and sets it up to start playing */ int playSound(struct sound *s) @@ -225,9 +225,9 @@ playSound(struct sound *s) return selected_channel; } -/* - Called from SDL's audio system. Supplies sound input with data by mixing together all - currently playing sound effects. +/* + 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) @@ -273,7 +273,7 @@ main(int argc, char *argv[]) int done; /* has user tried to quit ? */ SDL_Window *window; /* main window */ - SDL_Renderer *renderer; + SDL_Renderer *renderer; SDL_Event event; Uint32 startFrame; /* holds when frame started processing */ Uint32 endFrame; /* holds when frame ended processing */ diff --git a/Xcode-iOS/Demos/src/rectangles.c b/Xcode-iOS/Demos/src/rectangles.c index 4dcb32035..035e4f982 100644 --- a/Xcode-iOS/Demos/src/rectangles.c +++ b/Xcode-iOS/Demos/src/rectangles.c @@ -1,7 +1,7 @@ /* - * rectangles.c - * written by Holmes Futrell - * use however you want + * rectangles.c + * written by Holmes Futrell + * use however you want */ #include "SDL.h" @@ -37,50 +37,45 @@ render(SDL_Renderer *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) { - fatalError("Could not initialize SDL"); + if (SDL_Init(SDL_INIT_VIDEO/* | SDL_INIT_AUDIO*/) < 0) + { + printf("Unable to initialize SDL"); } - - /* seed random number generator */ - srand(time(NULL)); - - /* create window and renderer */ - window = - SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, - SDL_WINDOW_SHOWN); - if (window == 0) { - fatalError("Could not initialize Window"); - } - renderer = SDL_CreateRenderer(window, -1, 0); - if (!renderer) { - fatalError("Could not create renderer"); - } - - /* Fill screen with black */ - SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); - SDL_RenderClear(renderer); - - /* Enter render loop, waiting for user to quit */ - done = 0; - while (!done) { - while (SDL_PollEvent(&event)) { - if (event.type == SDL_QUIT) { - done = 1; - } + + 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; } - render(renderer); - SDL_Delay(1); } - - /* shutdown SDL */ - SDL_Quit(); + + 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 index 8ce8006a0..e811967b1 100644 --- a/Xcode-iOS/Demos/src/touch.c +++ b/Xcode-iOS/Demos/src/touch.c @@ -1,7 +1,7 @@ /* - * touch.c - * written by Holmes Futrell - * use however you want + * touch.c + * written by Holmes Futrell + * use however you want */ #include "SDL.h" @@ -14,8 +14,8 @@ 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 + 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) @@ -48,7 +48,7 @@ drawLine(SDL_Renderer *renderer, float startx, float starty, float dx, float dy) } /* - loads the brush texture + loads the brush texture */ void initializeTexture(SDL_Renderer *renderer) @@ -78,7 +78,7 @@ main(int argc, char *argv[]) Uint8 state; /* mouse (touch) state */ SDL_Event event; SDL_Window *window; /* main window */ - SDL_Renderer *renderer; + SDL_Renderer *renderer; int done; /* does user want to quit? */ /* initialize SDL */ @@ -88,7 +88,7 @@ main(int argc, char *argv[]) /* create main window and renderer */ window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | + SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); renderer = SDL_CreateRenderer(window, 0, 0); diff --git a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj index 5fcc8c932..4d349d28a 100755 --- a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj @@ -21,32 +21,8 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 001E39A71196EE6F00A3F5B8 /* TestSupportRWops_Cocoa.m in Sources */ = {isa = PBXBuildFile; fileRef = 001E39A51196EE6F00A3F5B8 /* TestSupportRWops_Cocoa.m */; }; - 006E9852119550FB001DE610 /* audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9831119550FB001DE610 /* audio.c */; }; - 006E9853119550FB001DE610 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9834119550FB001DE610 /* common.c */; }; - 006E9859119550FB001DE610 /* platform.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E983D119550FB001DE610 /* platform.c */; }; - 006E985A119550FB001DE610 /* README in Resources */ = {isa = PBXBuildFile; fileRef = 006E983F119550FB001DE610 /* README */; }; - 006E985B119550FB001DE610 /* rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9841119550FB001DE610 /* rect.c */; }; - 006E985C119550FB001DE610 /* render.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9844119550FB001DE610 /* render.c */; }; - 006E985D119550FB001DE610 /* read in Copy rwops */ = {isa = PBXBuildFile; fileRef = 006E9847119550FB001DE610 /* read */; }; - 006E985E119550FB001DE610 /* rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9848119550FB001DE610 /* rwops.c */; }; - 006E9860119550FB001DE610 /* SDL_at.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E984C119550FB001DE610 /* SDL_at.c */; }; - 006E9861119550FB001DE610 /* surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E984F119550FB001DE610 /* surface.c */; }; - 006E9862119550FB001DE610 /* testsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9851119550FB001DE610 /* testsdl.c */; }; - 006E986A1195513D001DE610 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 006E98631195513D001DE610 /* icon.bmp */; }; - 006E986B1195513D001DE610 /* moose.dat in Resources */ = {isa = PBXBuildFile; fileRef = 006E98641195513D001DE610 /* moose.dat */; }; - 006E986C1195513D001DE610 /* picture.xbm in Resources */ = {isa = PBXBuildFile; fileRef = 006E98651195513D001DE610 /* picture.xbm */; }; - 006E986E1195513D001DE610 /* sample.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 006E98671195513D001DE610 /* sample.bmp */; }; - 006E986F1195513D001DE610 /* sample.wav in Resources */ = {isa = PBXBuildFile; fileRef = 006E98681195513D001DE610 /* sample.wav */; }; - 006E98701195513D001DE610 /* utf8.txt in Resources */ = {isa = PBXBuildFile; fileRef = 006E98691195513D001DE610 /* utf8.txt */; }; 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 */; }; - 0098A55B1195B4D900343137 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A55A1195B4D900343137 /* AudioToolbox.framework */; }; - 0098A55F1195B4D900343137 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A55E1195B4D900343137 /* CoreAudio.framework */; }; - 0098A5611195B4D900343137 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5601195B4D900343137 /* CoreGraphics.framework */; }; - 0098A5631195B4D900343137 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5621195B4D900343137 /* OpenGLES.framework */; }; - 0098A5651195B4D900343137 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5641195B4D900343137 /* UIKit.framework */; }; - 0098A5851195B5E200343137 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0098A5841195B5E200343137 /* QuartzCore.framework */; }; 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 */; }; @@ -91,7 +67,6 @@ 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 */; }; - 22C905CD13A22646003FE4E4 /* SDL_hints_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 22C905CC13A22646003FE4E4 /* SDL_hints_c.h */; }; 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 */; }; @@ -100,6 +75,7 @@ 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 */; }; @@ -156,7 +132,6 @@ 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 */; }; - AA9781C91576A7FA00472542 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD6526630DE8FCCB002AD96B /* libSDL2.a */; }; 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 */; }; @@ -184,7 +159,6 @@ 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 */; }; - FD6526790DE8FCDD002AD96B /* SDL_fatal.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9D60DD52EDC00FB1D6B /* SDL_fatal.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 */; }; @@ -235,78 +209,11 @@ 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 */; }; - FDC656480E560DF800311C8E /* jumphack.c in Sources */ = {isa = PBXBuildFile; fileRef = FDC656440E560DF800311C8E /* jumphack.c */; }; - FDC656490E560DF800311C8E /* jumphack.h in Headers */ = {isa = PBXBuildFile; fileRef = FDC656450E560DF800311C8E /* jumphack.h */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 006E982A11955065001DE610 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; - proxyType = 1; - remoteGlobalIDString = FD6526620DE8FCCB002AD96B; - remoteInfo = StaticLib; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 006E9881119551D0001DE610 /* Copy rwops */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = rwops; - dstSubfolderSpec = 7; - files = ( - 006E985D119550FB001DE610 /* read in Copy rwops */, - ); - name = "Copy rwops"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ - 001E39A51196EE6F00A3F5B8 /* TestSupportRWops_Cocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestSupportRWops_Cocoa.m; sourceTree = ""; }; - 001E39A61196EE6F00A3F5B8 /* TestSupportRWops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestSupportRWops.h; sourceTree = ""; }; - 006E982211955059001DE610 /* testsdl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsdl.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 006E982411955059001DE610 /* testsdl-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "testsdl-Info.plist"; sourceTree = ""; }; - 006E9831119550FB001DE610 /* audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = audio.c; sourceTree = ""; }; - 006E9832119550FB001DE610 /* audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audio.h; sourceTree = ""; }; - 006E9834119550FB001DE610 /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = common.c; sourceTree = ""; }; - 006E9835119550FB001DE610 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = ""; }; - 006E9836119550FB001DE610 /* images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = images.h; sourceTree = ""; }; - 006E9837119550FB001DE610 /* img_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_blit.c; sourceTree = ""; }; - 006E9838119550FB001DE610 /* img_blitblend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_blitblend.c; sourceTree = ""; }; - 006E9839119550FB001DE610 /* img_face.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_face.c; sourceTree = ""; }; - 006E983A119550FB001DE610 /* img_primitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_primitives.c; sourceTree = ""; }; - 006E983B119550FB001DE610 /* img_primitivesblend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_primitivesblend.c; sourceTree = ""; }; - 006E983D119550FB001DE610 /* platform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = platform.c; sourceTree = ""; }; - 006E983E119550FB001DE610 /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = ""; }; - 006E983F119550FB001DE610 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README; path = ../../test/automated/README; sourceTree = SOURCE_ROOT; }; - 006E9841119550FB001DE610 /* rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rect.c; sourceTree = ""; }; - 006E9842119550FB001DE610 /* rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rect.h; sourceTree = ""; }; - 006E9844119550FB001DE610 /* render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = render.c; sourceTree = ""; }; - 006E9845119550FB001DE610 /* render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = render.h; sourceTree = ""; }; - 006E9847119550FB001DE610 /* read */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = read; sourceTree = ""; }; - 006E9848119550FB001DE610 /* rwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rwops.c; sourceTree = ""; }; - 006E9849119550FB001DE610 /* rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rwops.h; sourceTree = ""; }; - 006E984C119550FB001DE610 /* SDL_at.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_at.c; path = ../../test/automated/SDL_at.c; sourceTree = SOURCE_ROOT; }; - 006E984D119550FB001DE610 /* SDL_at.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_at.h; path = ../../test/automated/SDL_at.h; sourceTree = SOURCE_ROOT; }; - 006E984F119550FB001DE610 /* surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = surface.c; sourceTree = ""; }; - 006E9850119550FB001DE610 /* surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = surface.h; sourceTree = ""; }; - 006E9851119550FB001DE610 /* testsdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsdl.c; path = ../../test/automated/testsdl.c; sourceTree = SOURCE_ROOT; }; - 006E98631195513D001DE610 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; }; - 006E98641195513D001DE610 /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; }; - 006E98651195513D001DE610 /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; }; - 006E98671195513D001DE610 /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; }; - 006E98681195513D001DE610 /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; }; - 006E98691195513D001DE610 /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; }; 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 = ""; }; - 0098A55A1195B4D900343137 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - 0098A55E1195B4D900343137 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; - 0098A5601195B4D900343137 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 0098A5621195B4D900343137 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; - 0098A5641195B4D900343137 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 0098A5841195B5E200343137 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 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 = ""; }; @@ -351,7 +258,6 @@ 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 = ""; }; - 22C905CC13A22646003FE4E4 /* SDL_hints_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_hints_c.h; path = ../../src/SDL_hints_c.h; 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; }; @@ -360,6 +266,7 @@ 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 = ""; }; @@ -478,8 +385,6 @@ 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 = ""; }; - FD99B9D60DD52EDC00FB1D6B /* SDL_fatal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_fatal.c; path = ../../src/SDL_fatal.c; sourceTree = ""; }; - FD99B9D70DD52EDC00FB1D6B /* SDL_fatal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_fatal.h; path = ../../src/SDL_fatal.h; 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 = ""; }; @@ -519,138 +424,9 @@ 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 = ""; }; - FDC656440E560DF800311C8E /* jumphack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jumphack.c; sourceTree = ""; }; - FDC656450E560DF800311C8E /* jumphack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jumphack.h; sourceTree = ""; }; /* End PBXFileReference section */ -/* Begin PBXFrameworksBuildPhase section */ - 006E982011955059001DE610 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 0098A55B1195B4D900343137 /* AudioToolbox.framework in Frameworks */, - 0098A55F1195B4D900343137 /* CoreAudio.framework in Frameworks */, - 0098A5611195B4D900343137 /* CoreGraphics.framework in Frameworks */, - 0098A5631195B4D900343137 /* OpenGLES.framework in Frameworks */, - 0098A5651195B4D900343137 /* UIKit.framework in Frameworks */, - 0098A5851195B5E200343137 /* QuartzCore.framework in Frameworks */, - AA9781C91576A7FA00472542 /* libSDL2.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - /* Begin PBXGroup section */ - 006E982E119550D8001DE610 /* AutomatedTests */ = { - isa = PBXGroup; - children = ( - 006E9830119550FB001DE610 /* audio */, - 006E9833119550FB001DE610 /* common */, - 006E983C119550FB001DE610 /* platform */, - 006E983F119550FB001DE610 /* README */, - 006E9840119550FB001DE610 /* rect */, - 006E9843119550FB001DE610 /* render */, - 006E9846119550FB001DE610 /* rwops */, - 006E984C119550FB001DE610 /* SDL_at.c */, - 006E984D119550FB001DE610 /* SDL_at.h */, - 006E984E119550FB001DE610 /* surface */, - 006E9851119550FB001DE610 /* testsdl.c */, - ); - name = AutomatedTests; - sourceTree = ""; - }; - 006E982F119550E4001DE610 /* TestResources */ = { - isa = PBXGroup; - children = ( - 006E98631195513D001DE610 /* icon.bmp */, - 006E98641195513D001DE610 /* moose.dat */, - 006E98651195513D001DE610 /* picture.xbm */, - 006E98671195513D001DE610 /* sample.bmp */, - 006E98681195513D001DE610 /* sample.wav */, - 006E98691195513D001DE610 /* utf8.txt */, - ); - name = TestResources; - sourceTree = ""; - }; - 006E9830119550FB001DE610 /* audio */ = { - isa = PBXGroup; - children = ( - 006E9831119550FB001DE610 /* audio.c */, - 006E9832119550FB001DE610 /* audio.h */, - ); - name = audio; - path = ../../test/automated/audio; - sourceTree = SOURCE_ROOT; - }; - 006E9833119550FB001DE610 /* common */ = { - isa = PBXGroup; - children = ( - 006E9834119550FB001DE610 /* common.c */, - 006E9835119550FB001DE610 /* common.h */, - 006E9836119550FB001DE610 /* images.h */, - 006E9837119550FB001DE610 /* img_blit.c */, - 006E9838119550FB001DE610 /* img_blitblend.c */, - 006E9839119550FB001DE610 /* img_face.c */, - 006E983A119550FB001DE610 /* img_primitives.c */, - 006E983B119550FB001DE610 /* img_primitivesblend.c */, - ); - name = common; - path = ../../test/automated/common; - sourceTree = SOURCE_ROOT; - }; - 006E983C119550FB001DE610 /* platform */ = { - isa = PBXGroup; - children = ( - 006E983D119550FB001DE610 /* platform.c */, - 006E983E119550FB001DE610 /* platform.h */, - ); - name = platform; - path = ../../test/automated/platform; - sourceTree = SOURCE_ROOT; - }; - 006E9840119550FB001DE610 /* rect */ = { - isa = PBXGroup; - children = ( - 006E9841119550FB001DE610 /* rect.c */, - 006E9842119550FB001DE610 /* rect.h */, - ); - name = rect; - path = ../../test/automated/rect; - sourceTree = SOURCE_ROOT; - }; - 006E9843119550FB001DE610 /* render */ = { - isa = PBXGroup; - children = ( - 006E9844119550FB001DE610 /* render.c */, - 006E9845119550FB001DE610 /* render.h */, - ); - name = render; - path = ../../test/automated/render; - sourceTree = SOURCE_ROOT; - }; - 006E9846119550FB001DE610 /* rwops */ = { - isa = PBXGroup; - children = ( - 001E39A51196EE6F00A3F5B8 /* TestSupportRWops_Cocoa.m */, - 001E39A61196EE6F00A3F5B8 /* TestSupportRWops.h */, - 006E9847119550FB001DE610 /* read */, - 006E9848119550FB001DE610 /* rwops.c */, - 006E9849119550FB001DE610 /* rwops.h */, - ); - name = rwops; - path = ../../test/automated/rwops; - sourceTree = SOURCE_ROOT; - }; - 006E984E119550FB001DE610 /* surface */ = { - isa = PBXGroup; - children = ( - 006E984F119550FB001DE610 /* surface.c */, - 006E9850119550FB001DE610 /* surface.h */, - ); - name = surface; - path = ../../test/automated/surface; - sourceTree = SOURCE_ROOT; - }; 006E9885119552DD001DE610 /* cocoa */ = { isa = PBXGroup; children = ( @@ -758,7 +534,6 @@ isa = PBXGroup; children = ( FD6526630DE8FCCB002AD96B /* libSDL2.a */, - 006E982211955059001DE610 /* testsdl.app */, ); name = Products; sourceTree = ""; @@ -768,29 +543,12 @@ children = ( FD99B8BC0DD52E5C00FB1D6B /* Public Headers */, FD99B8BD0DD52E6D00FB1D6B /* Library Source */, - 006E982E119550D8001DE610 /* AutomatedTests */, - 006E982F119550E4001DE610 /* TestResources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, - 006E982411955059001DE610 /* testsdl-Info.plist */, - 0098A5841195B5E200343137 /* QuartzCore.framework */, ); name = CustomTemplate; sourceTree = ""; usesTabs = 0; }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 0098A55A1195B4D900343137 /* AudioToolbox.framework */, - 0098A55E1195B4D900343137 /* CoreAudio.framework */, - 0098A5601195B4D900343137 /* CoreGraphics.framework */, - 0098A5621195B4D900343137 /* OpenGLES.framework */, - 0098A5641195B4D900343137 /* UIKit.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 56EA86F813E9EBF9002E47EB /* coreaudio */ = { isa = PBXGroup; children = ( @@ -857,8 +615,6 @@ FD689F090E26E5D900F90B21 /* uikit */ = { isa = PBXGroup; children = ( - FDC656440E560DF800311C8E /* jumphack.c */, - FDC656450E560DF800311C8E /* jumphack.h */, FDC261780E3A3FC8001C4554 /* keyinfotable.h */, FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */, FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */, @@ -984,10 +740,7 @@ 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */, FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */, FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */, - FD99B9D60DD52EDC00FB1D6B /* SDL_fatal.c */, - FD99B9D70DD52EDC00FB1D6B /* SDL_fatal.h */, 0442EC5412FE1C3F004C9285 /* SDL_hints.c */, - 22C905CC13A22646003FE4E4 /* SDL_hints_c.h */, 04BAC09B1300C1290055DE28 /* SDL_log.c */, FD99B9D80DD52EDC00FB1D6B /* SDL.c */, ); @@ -1093,6 +846,7 @@ FD99BA0A0DD52EDC00FB1D6B /* SDL_syssem.c */, FD99BA0B0DD52EDC00FB1D6B /* SDL_systhread.c */, FD99BA0C0DD52EDC00FB1D6B /* SDL_systhread_c.h */, + AA0F8494178D5F1A00823F9D /* SDL_systls.c */, ); path = pthread; sourceTree = ""; @@ -1187,7 +941,6 @@ FD689F240E26E5D900F90B21 /* SDL_uikitwindow.h in Headers */, FD689F260E26E5D900F90B21 /* SDL_uikitopenglview.h in Headers */, FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */, - FDC656490E560DF800311C8E /* jumphack.h in Headers */, 047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */, 046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */, 006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */, @@ -1207,7 +960,6 @@ 0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */, 0402A85A12FE70C600CECEE3 /* SDL_shaders_gles2.h in Headers */, 04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */, - 22C905CD13A22646003FE4E4 /* SDL_hints_c.h in Headers */, 56EA86FC13E9EC2B002E47EB /* SDL_coreaudio.h in Headers */, 93CB792313FC5E5200BD3E05 /* SDL_uikitviewcontroller.h in Headers */, AA628ADC159369E3005138DD /* SDL_rotate.h in Headers */, @@ -1273,25 +1025,6 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 006E982111955059001DE610 /* testsdl */ = { - isa = PBXNativeTarget; - buildConfigurationList = 006E98271195505B001DE610 /* Build configuration list for PBXNativeTarget "testsdl" */; - buildPhases = ( - 006E981E11955059001DE610 /* Resources */, - 006E981F11955059001DE610 /* Sources */, - 006E982011955059001DE610 /* Frameworks */, - 006E9881119551D0001DE610 /* Copy rwops */, - ); - buildRules = ( - ); - dependencies = ( - 006E982B11955065001DE610 /* PBXTargetDependency */, - ); - name = testsdl; - productName = testsdl; - productReference = 006E982211955059001DE610 /* testsdl.app */; - productType = "com.apple.product-type.application"; - }; FD6526620DE8FCCB002AD96B /* libSDL */ = { isa = PBXNativeTarget; buildConfigurationList = FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL" */; @@ -1331,29 +1064,11 @@ projectRoot = ../..; targets = ( FD6526620DE8FCCB002AD96B /* libSDL */, - 006E982111955059001DE610 /* testsdl */, 00B4F48B12F6A69C0084EC00 /* PrepareXcodeProjectTemplate */, ); }; /* End PBXProject section */ -/* Begin PBXResourcesBuildPhase section */ - 006E981E11955059001DE610 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 006E985A119550FB001DE610 /* README in Resources */, - 006E986A1195513D001DE610 /* icon.bmp in Resources */, - 006E986B1195513D001DE610 /* moose.dat in Resources */, - 006E986C1195513D001DE610 /* picture.xbm in Resources */, - 006E986E1195513D001DE610 /* sample.bmp in Resources */, - 006E986F1195513D001DE610 /* sample.wav in Resources */, - 006E98701195513D001DE610 /* utf8.txt in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - /* Begin PBXShellScriptBuildPhase section */ 00B4F48A12F6A69C0084EC00 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -1372,23 +1087,6 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 006E981F11955059001DE610 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 006E9852119550FB001DE610 /* audio.c in Sources */, - 006E9853119550FB001DE610 /* common.c in Sources */, - 006E9859119550FB001DE610 /* platform.c in Sources */, - 006E985B119550FB001DE610 /* rect.c in Sources */, - 006E985C119550FB001DE610 /* render.c in Sources */, - 006E985E119550FB001DE610 /* rwops.c in Sources */, - 006E9860119550FB001DE610 /* SDL_at.c in Sources */, - 006E9861119550FB001DE610 /* surface.c in Sources */, - 006E9862119550FB001DE610 /* testsdl.c in Sources */, - 001E39A71196EE6F00A3F5B8 /* TestSupportRWops_Cocoa.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; FD6526600DE8FCCB002AD96B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1410,7 +1108,6 @@ FD6526750DE8FCDD002AD96B /* SDL_windowevents.c in Sources */, FD6526760DE8FCDD002AD96B /* SDL_rwops.c in Sources */, FD6526780DE8FCDD002AD96B /* SDL_error.c in Sources */, - FD6526790DE8FCDD002AD96B /* SDL_fatal.c in Sources */, FD65267A0DE8FCDD002AD96B /* SDL.c in Sources */, FD65267B0DE8FCDD002AD96B /* SDL_syscond.c in Sources */, FD65267C0DE8FCDD002AD96B /* SDL_sysmutex.c in Sources */, @@ -1450,7 +1147,6 @@ FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */, FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */, FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */, - FDC656480E560DF800311C8E /* jumphack.c in Sources */, 047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */, 047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */, 047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */, @@ -1487,54 +1183,13 @@ 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 PBXTargetDependency section */ - 006E982B11955065001DE610 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = FD6526620DE8FCCB002AD96B /* libSDL */; - targetProxy = 006E982A11955065001DE610 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ - 006E98251195505B001DE610 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - INFOPLIST_FILE = "testsdl-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - UIKit, - ); - PRODUCT_NAME = testsdl; - }; - name = Debug; - }; - 006E98261195505B001DE610 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - INFOPLIST_FILE = "testsdl-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - UIKit, - ); - PRODUCT_NAME = testsdl; - }; - name = Release; - }; 00B4F48C12F6A69C0084EC00 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1603,15 +1258,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 006E98271195505B001DE610 /* Build configuration list for PBXNativeTarget "testsdl" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 006E98251195505B001DE610 /* Debug */, - 006E98261195505B001DE610 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 00B4F48E12F6A6BA0084EC00 /* Build configuration list for PBXAggregateTarget "PrepareXcodeProjectTemplate" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Xcode-iOS/SDL/testsdl-Info.plist b/Xcode-iOS/SDL/testsdl-Info.plist deleted file mode 100644 index af9a1cadb..000000000 --- a/Xcode-iOS/SDL/testsdl-Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - - diff --git a/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj b/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj new file mode 100644 index 000000000..0995735e9 --- /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/main.c b/Xcode-iOS/Template/SDL iOS Application/main.c index 2a5d3f2ac..8dc00706f 100644 --- a/Xcode-iOS/Template/SDL iOS Application/main.c +++ b/Xcode-iOS/Template/SDL iOS Application/main.c @@ -1,7 +1,7 @@ /* - * rectangles.c - * written by Holmes Futrell - * use however you want + * rectangles.c + * written by Holmes Futrell + * use however you want */ #include "SDL.h" @@ -67,7 +67,7 @@ main(int argc, char *argv[]) /* create window and renderer */ window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, - SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN); + SDL_WINDOW_OPENGL); if (!window) { printf("Could not initialize Window\n"); return 1; diff --git a/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj b/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj index 1993661b1..0b35c22cf 100755 --- a/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj +++ b/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj @@ -36,8 +36,14 @@ 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 */; }; - AAE7DEDE14CBB1E100DF1A0E /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7840E2D0F1F00EA573E /* common.c */; }; 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 */; }; @@ -50,7 +56,6 @@ 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 */; }; - AAE7DFA314CBB54E00DF1A0E /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7840E2D0F1F00EA573E /* common.c */; }; 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 */; }; @@ -60,7 +65,6 @@ 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 */; }; - FDA8A79B0E2D0F8B00EA573E /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7840E2D0F1F00EA573E /* common.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 */; }; @@ -111,7 +115,6 @@ 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 */; }; - FDAAC7780E2D7024001DB1D8 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7840E2D0F1F00EA573E /* common.c */; }; 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 */; }; @@ -138,7 +141,6 @@ 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 */; }; - FDC4301F0F0D8702009C87E1 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7840E2D0F1F00EA573E /* common.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 */; }; @@ -205,7 +207,6 @@ 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 */; }; - FDD2C5630E2E815C00B7A85F /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7840E2D0F1F00EA573E /* common.c */; }; 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 */; }; @@ -242,6 +243,13 @@ 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 */; @@ -259,6 +267,7 @@ 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; }; @@ -280,8 +289,6 @@ 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; }; - FDA8A7840E2D0F1F00EA573E /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = common.c; path = ../../test/common.c; sourceTree = SOURCE_ROOT; }; - FDA8A7850E2D0F1F00EA573E /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = ../../test/common.h; 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; }; @@ -337,6 +344,7 @@ 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 */, @@ -352,6 +360,7 @@ 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 */, @@ -382,6 +391,7 @@ 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 */, @@ -397,6 +407,7 @@ 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 */, @@ -472,6 +483,7 @@ 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 */, @@ -487,6 +499,7 @@ 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 */, @@ -607,6 +620,7 @@ 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 */, @@ -699,6 +713,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */, FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */, FDA8AAD60E2D339A00EA573E /* Resources */, FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */, @@ -708,6 +723,14 @@ name = CustomTemplate; sourceTree = ""; }; + AA1EE44E176059220029C7A5 /* Products */ = { + isa = PBXGroup; + children = ( + AA1EE452176059230029C7A5 /* libSDL2test.a */, + ); + name = Products; + sourceTree = ""; + }; FD1B48AD0E3131CA007AB34E /* Products */ = { isa = PBXGroup; children = ( @@ -721,8 +744,6 @@ isa = PBXGroup; children = ( 047A63F013285CD100CD7973 /* checkkeys.c */, - FDA8A7840E2D0F1F00EA573E /* common.c */, - FDA8A7850E2D0F1F00EA573E /* common.h */, FDA8A78B0E2D0F3D00EA573E /* loopwave.c */, FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */, FDC430090F0D86BF009C87E1 /* testdraw2.c */, @@ -1196,6 +1217,10 @@ ProductGroup = FD1B48AD0E3131CA007AB34E /* Products */; ProjectRef = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */; }, + { + ProductGroup = AA1EE44E176059220029C7A5 /* Products */; + ProjectRef = AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */; + }, ); projectRoot = ""; targets = ( @@ -1234,6 +1259,13 @@ 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; @@ -1440,7 +1472,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FDA8A79B0E2D0F8B00EA573E /* common.c in Sources */, FDA8A79C0E2D0F9300EA573E /* testwm2.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1457,7 +1488,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - AAE7DEDE14CBB1E100DF1A0E /* common.c in Sources */, AAE7DF4614CBB43900DF1A0E /* testscale.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1466,7 +1496,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - AAE7DFA314CBB54E00DF1A0E /* common.c in Sources */, AAE7DFB514CBB5F700DF1A0E /* testrendertarget.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1508,7 +1537,6 @@ buildActionMask = 2147483647; files = ( FDAAC62A0E2D5960001DB1D8 /* testgles.c in Sources */, - FDAAC7780E2D7024001DB1D8 /* common.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1516,7 +1544,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FDC4301F0F0D8702009C87E1 /* common.c in Sources */, FDC4300A0F0D86BF009C87E1 /* testdraw2.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1581,7 +1608,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FDD2C5630E2E815C00B7A85F /* common.c in Sources */, FDD2C5510E2E80F400B7A85F /* testsprite2.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Xcode/SDL/Info-Framework.plist b/Xcode/SDL/Info-Framework.plist index 544baa635..0ab4b25e3 100644 --- a/Xcode/SDL/Info-Framework.plist +++ b/Xcode/SDL/Info-Framework.plist @@ -22,5 +22,7 @@ SDLX CFBundleVersion 2.0.0 + CFBundleExecutable + ${EXECUTABLE_NAME} diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 370e4de6d..3757efde0 100755 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -6,31 +6,7 @@ objectVersion = 46; objects = { -/* Begin PBXAggregateTarget section */ - 0083103F1072EA5700A531F1 /* Generate Doxygen DocSet */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 008310471072EAAE00A531F1 /* Build configuration list for PBXAggregateTarget "Generate Doxygen DocSet" */; - buildPhases = ( - 0083103E1072EA5700A531F1 /* ShellScript */, - ); - dependencies = ( - ); - name = "Generate Doxygen DocSet"; - productName = "Generate Doxygen DocSet"; - }; -/* End PBXAggregateTarget section */ - /* Begin PBXBuildFile section */ - 001E39EE1196F75000A3F5B8 /* TestSupportRWops_Cocoa.m in Sources */ = {isa = PBXBuildFile; fileRef = 001E39EC1196F75000A3F5B8 /* TestSupportRWops_Cocoa.m */; }; - 006E94A3119511A1001DE610 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 006E949C119511A1001DE610 /* icon.bmp */; }; - 006E94A4119511A1001DE610 /* moose.dat in Resources */ = {isa = PBXBuildFile; fileRef = 006E949D119511A1001DE610 /* moose.dat */; }; - 006E94A5119511A1001DE610 /* picture.xbm in Resources */ = {isa = PBXBuildFile; fileRef = 006E949E119511A1001DE610 /* picture.xbm */; }; - 006E94A7119511A1001DE610 /* sample.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 006E94A0119511A1001DE610 /* sample.bmp */; }; - 006E94A8119511A1001DE610 /* sample.wav in Resources */ = {isa = PBXBuildFile; fileRef = 006E94A1119511A1001DE610 /* sample.wav */; }; - 006E94A9119511A1001DE610 /* utf8.txt in Resources */ = {isa = PBXBuildFile; fileRef = 006E94A2119511A1001DE610 /* utf8.txt */; }; - 006E94BC11951217001DE610 /* read in Copy rwops */ = {isa = PBXBuildFile; fileRef = 00D8DA121195093100638393 /* read */; }; - 006E94EF11951255001DE610 /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BECDF66C0761BA81005FE872 /* SDL2.framework */; }; - 006E94F01195125B001DE610 /* SDL2.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = BECDF66C0761BA81005FE872 /* SDL2.framework */; }; 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 */; }; @@ -47,15 +23,6 @@ 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 */; }; - 00D8DA1B1195093100638393 /* audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8D9FC1195093100638393 /* audio.c */; }; - 00D8DA1C1195093100638393 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8D9FF1195093100638393 /* common.c */; }; - 00D8DA221195093100638393 /* platform.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA081195093100638393 /* platform.c */; }; - 00D8DA241195093100638393 /* rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA0C1195093100638393 /* rect.c */; }; - 00D8DA251195093100638393 /* render.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA0F1195093100638393 /* render.c */; }; - 00D8DA271195093100638393 /* rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA131195093100638393 /* rwops.c */; }; - 00D8DA281195093100638393 /* SDL_at.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA151195093100638393 /* SDL_at.c */; }; - 00D8DA291195093100638393 /* surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA181195093100638393 /* surface.c */; }; - 00D8DA2A1195093100638393 /* testsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA1A1195093100638393 /* testsdl.c */; }; 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 */; }; @@ -146,8 +113,6 @@ 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 */; }; - 04BD00A012E6671800899322 /* SDL_fatal.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5A12E6671700899322 /* SDL_fatal.c */; }; - 04BD00A112E6671800899322 /* SDL_fatal.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5B12E6671700899322 /* SDL_fatal.h */; }; 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 */; }; @@ -302,8 +267,6 @@ 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 */; }; - 04BD02BA12E6671800899322 /* SDL_fatal.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5A12E6671700899322 /* SDL_fatal.c */; }; - 04BD02BB12E6671800899322 /* SDL_fatal.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5B12E6671700899322 /* SDL_fatal.h */; }; 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 */; }; @@ -431,6 +394,9 @@ 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 */; }; @@ -550,23 +516,268 @@ 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 */ - 008310451072EA9000A531F1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 0083103F1072EA5700A531F1; - remoteInfo = "Generate Doxygen DocSet"; - }; - 00D8DA2E1195094500638393 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BECDF5FE0761BA81005FE872; - remoteInfo = Framework; - }; BECDF6C50761BA81005FE872 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -576,40 +787,7 @@ }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - 006E9491119510E1001DE610 /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 006E94F01195125B001DE610 /* SDL2.framework in Copy Frameworks */, - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; - 006E94B3119511CE001DE610 /* Copy rwops */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = rwops; - dstSubfolderSpec = 7; - files = ( - 006E94BC11951217001DE610 /* read in Copy rwops */, - ); - name = "Copy rwops"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ - 001E39EC1196F75000A3F5B8 /* TestSupportRWops_Cocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestSupportRWops_Cocoa.m; sourceTree = ""; }; - 001E39ED1196F75000A3F5B8 /* TestSupportRWops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestSupportRWops.h; sourceTree = ""; }; - 006E949C119511A1001DE610 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; }; - 006E949D119511A1001DE610 /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; }; - 006E949E119511A1001DE610 /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; }; - 006E94A0119511A1001DE610 /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; }; - 006E94A1119511A1001DE610 /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; }; - 006E94A2119511A1001DE610 /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; }; 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 = ""; }; @@ -617,38 +795,10 @@ 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 = ""; }; 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 = ""; }; 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 = ""; }; - 00D8D9EF1195090700638393 /* testsdl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsdl.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 00D8D9F11195090700638393 /* testsdl-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "testsdl-Info.plist"; sourceTree = ""; }; - 00D8D9FC1195093100638393 /* audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = audio.c; sourceTree = ""; }; - 00D8D9FD1195093100638393 /* audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audio.h; sourceTree = ""; }; - 00D8D9FF1195093100638393 /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = common.c; sourceTree = ""; }; - 00D8DA001195093100638393 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = ""; }; - 00D8DA011195093100638393 /* images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = images.h; sourceTree = ""; }; - 00D8DA021195093100638393 /* img_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_blit.c; sourceTree = ""; }; - 00D8DA031195093100638393 /* img_blitblend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_blitblend.c; sourceTree = ""; }; - 00D8DA041195093100638393 /* img_face.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_face.c; sourceTree = ""; }; - 00D8DA051195093100638393 /* img_primitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_primitives.c; sourceTree = ""; }; - 00D8DA061195093100638393 /* img_primitivesblend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_primitivesblend.c; sourceTree = ""; }; - 00D8DA081195093100638393 /* platform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = platform.c; sourceTree = ""; }; - 00D8DA091195093100638393 /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = ""; }; - 00D8DA0A1195093100638393 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README; path = ../../test/automated/README; sourceTree = SOURCE_ROOT; }; - 00D8DA0C1195093100638393 /* rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rect.c; sourceTree = ""; }; - 00D8DA0D1195093100638393 /* rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rect.h; sourceTree = ""; }; - 00D8DA0F1195093100638393 /* render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = render.c; sourceTree = ""; }; - 00D8DA101195093100638393 /* render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = render.h; sourceTree = ""; }; - 00D8DA121195093100638393 /* read */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = read; sourceTree = ""; }; - 00D8DA131195093100638393 /* rwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rwops.c; sourceTree = ""; }; - 00D8DA141195093100638393 /* rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rwops.h; sourceTree = ""; }; - 00D8DA151195093100638393 /* SDL_at.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_at.c; path = ../../test/automated/SDL_at.c; sourceTree = SOURCE_ROOT; }; - 00D8DA161195093100638393 /* SDL_at.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_at.h; path = ../../test/automated/SDL_at.h; sourceTree = SOURCE_ROOT; }; - 00D8DA181195093100638393 /* surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = surface.c; sourceTree = ""; }; - 00D8DA191195093100638393 /* surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = surface.h; sourceTree = ""; }; - 00D8DA1A1195093100638393 /* testsdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsdl.c; path = ../../test/automated/testsdl.c; sourceTree = SOURCE_ROOT; }; - 00F5D79E0990CA0D0051C449 /* UniversalBinaryNotes.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = UniversalBinaryNotes.rtf; 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 = ""; }; @@ -725,8 +875,6 @@ 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; }; - 04BDFE5A12E6671700899322 /* SDL_fatal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_fatal.c; path = ../../src/SDL_fatal.c; sourceTree = SOURCE_ROOT; }; - 04BDFE5B12E6671700899322 /* SDL_fatal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_fatal.h; path = ../../src/SDL_fatal.h; 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 = ""; }; @@ -837,6 +985,7 @@ 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 = ""; }; @@ -901,27 +1050,21 @@ 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; }; + 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 */ /* Begin PBXFrameworksBuildPhase section */ - 00D8D9ED1195090700638393 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 006E94EF11951255001DE610 /* SDL2.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; BECDF6680761BA81005FE872 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -949,122 +1092,28 @@ 007317AD0858DECD00B2BC32 /* IOKit.framework in Frameworks */, 007317AE0858DECD00B2BC32 /* OpenGL.framework in Frameworks */, 007317C30858E15000B2BC32 /* Carbon.framework in Frameworks */, + DB31408B17554D37006C0E22 /* ForceFeedback.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DB31406B17554B71006C0E22 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 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 */ - 006E949B11951160001DE610 /* TestResources */ = { - isa = PBXGroup; - children = ( - 006E949C119511A1001DE610 /* icon.bmp */, - 006E949D119511A1001DE610 /* moose.dat */, - 006E949E119511A1001DE610 /* picture.xbm */, - 006E94A0119511A1001DE610 /* sample.bmp */, - 006E94A1119511A1001DE610 /* sample.wav */, - 006E94A2119511A1001DE610 /* utf8.txt */, - ); - name = TestResources; - sourceTree = ""; - }; - 00D8D9FA1195091500638393 /* AutomatedTests */ = { - isa = PBXGroup; - children = ( - 00D8D9FB1195093100638393 /* audio */, - 00D8D9FE1195093100638393 /* common */, - 00D8DA071195093100638393 /* platform */, - 00D8DA0A1195093100638393 /* README */, - 00D8DA0B1195093100638393 /* rect */, - 00D8DA0E1195093100638393 /* render */, - 00D8DA111195093100638393 /* rwops */, - 00D8DA151195093100638393 /* SDL_at.c */, - 00D8DA161195093100638393 /* SDL_at.h */, - 00D8DA171195093100638393 /* surface */, - 00D8DA1A1195093100638393 /* testsdl.c */, - ); - name = AutomatedTests; - sourceTree = ""; - }; - 00D8D9FB1195093100638393 /* audio */ = { - isa = PBXGroup; - children = ( - 00D8D9FC1195093100638393 /* audio.c */, - 00D8D9FD1195093100638393 /* audio.h */, - ); - name = audio; - path = ../../test/automated/audio; - sourceTree = SOURCE_ROOT; - }; - 00D8D9FE1195093100638393 /* common */ = { - isa = PBXGroup; - children = ( - 00D8D9FF1195093100638393 /* common.c */, - 00D8DA001195093100638393 /* common.h */, - 00D8DA011195093100638393 /* images.h */, - 00D8DA021195093100638393 /* img_blit.c */, - 00D8DA031195093100638393 /* img_blitblend.c */, - 00D8DA041195093100638393 /* img_face.c */, - 00D8DA051195093100638393 /* img_primitives.c */, - 00D8DA061195093100638393 /* img_primitivesblend.c */, - ); - name = common; - path = ../../test/automated/common; - sourceTree = SOURCE_ROOT; - }; - 00D8DA071195093100638393 /* platform */ = { - isa = PBXGroup; - children = ( - 00D8DA081195093100638393 /* platform.c */, - 00D8DA091195093100638393 /* platform.h */, - ); - name = platform; - path = ../../test/automated/platform; - sourceTree = SOURCE_ROOT; - }; - 00D8DA0B1195093100638393 /* rect */ = { - isa = PBXGroup; - children = ( - 00D8DA0C1195093100638393 /* rect.c */, - 00D8DA0D1195093100638393 /* rect.h */, - ); - name = rect; - path = ../../test/automated/rect; - sourceTree = SOURCE_ROOT; - }; - 00D8DA0E1195093100638393 /* render */ = { - isa = PBXGroup; - children = ( - 00D8DA0F1195093100638393 /* render.c */, - 00D8DA101195093100638393 /* render.h */, - ); - name = render; - path = ../../test/automated/render; - sourceTree = SOURCE_ROOT; - }; - 00D8DA111195093100638393 /* rwops */ = { - isa = PBXGroup; - children = ( - 001E39EC1196F75000A3F5B8 /* TestSupportRWops_Cocoa.m */, - 001E39ED1196F75000A3F5B8 /* TestSupportRWops.h */, - 00D8DA121195093100638393 /* read */, - 00D8DA131195093100638393 /* rwops.c */, - 00D8DA141195093100638393 /* rwops.h */, - ); - name = rwops; - path = ../../test/automated/rwops; - sourceTree = SOURCE_ROOT; - }; - 00D8DA171195093100638393 /* surface */ = { - isa = PBXGroup; - children = ( - 00D8DA181195093100638393 /* surface.c */, - 00D8DA191195093100638393 /* surface.h */, - ); - name = surface; - path = ../../test/automated/surface; - sourceTree = SOURCE_ROOT; - }; 0153844A006D81B07F000001 /* Public Headers */ = { isa = PBXGroup; children = ( @@ -1133,8 +1182,7 @@ BECDF66C0761BA81005FE872 /* SDL2.framework */, BECDF6B30761BA81005FE872 /* libSDL2.a */, BECDF6BE0761BA81005FE872 /* Standard DMG */, - BECDF6C30761BA81005FE872 /* Developer Extras Package */, - 00D8D9EF1195090700638393 /* testsdl.app */, + DB31407717554B71006C0E22 /* libSDL2.dylib */, ); name = Products; sourceTree = ""; @@ -1418,6 +1466,7 @@ 04BDFE8112E6671800899322 /* SDL_syssem.c */, 04BDFE8212E6671800899322 /* SDL_systhread.c */, 04BDFE8312E6671800899322 /* SDL_systhread_c.h */, + AA0F8490178D5ECC00823F9D /* SDL_systls.c */, ); path = pthread; sourceTree = ""; @@ -1493,6 +1542,8 @@ 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 */, @@ -1560,21 +1611,21 @@ 0867D691FE84028FC02AAC07 /* SDLFramework */ = { isa = PBXGroup; children = ( - F5A2EF3900C6A39A01000001 /* BUGS */, - F5A2EF3A00C6A3C201000001 /* README.MacOSX */, + F5A2EF3900C6A39A01000001 /* BUGS.txt */, + F5A2EF3A00C6A3C201000001 /* README-macosx.txt */, F59C70FC00D5CB5801000001 /* pkg-support */, 0153844A006D81B07F000001 /* Public Headers */, 08FB77ACFE841707C02AAC07 /* Library Source */, - 00D8D9FA1195091500638393 /* AutomatedTests */, - 006E949B11951160001DE610 /* TestResources */, 034768DDFF38A45A11DB9C8B /* Products */, BECDF66B0761BA81005FE872 /* Info-Framework.plist */, BEC562FE0761C0E800A33029 /* Linked Frameworks */, - 00D8D9F11195090700638393 /* testsdl-Info.plist */, ); 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; @@ -1604,8 +1655,6 @@ 04BDFE5612E6671700899322 /* SDL_assert.c */, 04BDFE5812E6671700899322 /* SDL_error_c.h */, 04BDFE5912E6671700899322 /* SDL_error.c */, - 04BDFE5A12E6671700899322 /* SDL_fatal.c */, - 04BDFE5B12E6671700899322 /* SDL_fatal.h */, 0442EC5E12FE1C75004C9285 /* SDL_hints.c */, 04BAC0C71300C2160055DE28 /* SDL_log.c */, 04BDFE5C12E6671700899322 /* SDL.c */, @@ -1654,8 +1703,7 @@ F59C710100D5CB5801000001 /* resources */ = { isa = PBXGroup; children = ( - 00794D3F09D0C461003FC8A1 /* License.rtf */, - 00F5D79E0990CA0D0051C449 /* UniversalBinaryNotes.rtf */, + 00794D3F09D0C461003FC8A1 /* License.txt */, 00AE6E1E08B958CC00255E2F /* ReadMeDevLite.txt */, F59C710300D5CB5801000001 /* ReadMe.txt */, ); @@ -1750,7 +1798,6 @@ 04BD007212E6671800899322 /* SDL_sysjoystick.h in Headers */, 04BD009B12E6671800899322 /* SDL_assert_c.h in Headers */, 04BD009E12E6671800899322 /* SDL_error_c.h in Headers */, - 04BD00A112E6671800899322 /* SDL_fatal.h in Headers */, 04BD00BF12E6671800899322 /* SDL_sysmutex_c.h in Headers */, 04BD00C212E6671800899322 /* SDL_systhread_c.h in Headers */, 04BD00C912E6671800899322 /* SDL_systhread.h in Headers */, @@ -1808,6 +1855,7 @@ 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; }; @@ -1844,7 +1892,6 @@ 04BD028D12E6671800899322 /* SDL_sysjoystick.h in Headers */, 04BD02B512E6671800899322 /* SDL_assert_c.h in Headers */, 04BD02B812E6671800899322 /* SDL_error_c.h in Headers */, - 04BD02BB12E6671800899322 /* SDL_fatal.h in Headers */, 04BD02D912E6671800899322 /* SDL_sysmutex_c.h in Headers */, 04BD02DC12E6671800899322 /* SDL_systhread_c.h in Headers */, 04BD02E312E6671800899322 /* SDL_systhread.h in Headers */, @@ -1952,32 +1999,157 @@ 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; + }; + 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; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 00D8D9EE1195090700638393 /* testsdl */ = { - isa = PBXNativeTarget; - buildConfigurationList = 00D8D9F71195090900638393 /* Build configuration list for PBXNativeTarget "testsdl" */; - buildPhases = ( - 00D8D9EB1195090700638393 /* Resources */, - 00D8D9EC1195090700638393 /* Sources */, - 00D8D9ED1195090700638393 /* Frameworks */, - 006E9491119510E1001DE610 /* Copy Frameworks */, - 006E94B3119511CE001DE610 /* Copy rwops */, - ); - buildRules = ( - ); - dependencies = ( - 00D8DA2F1195094500638393 /* PBXTargetDependency */, - ); - name = testsdl; - productName = testsdl; - productReference = 00D8D9EF1195090700638393 /* testsdl.app */; - productType = "com.apple.product-type.application"; - }; BECDF5FE0761BA81005FE872 /* Framework */ = { isa = PBXNativeTarget; buildConfigurationList = 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */; @@ -1986,6 +2158,7 @@ BECDF62A0761BA81005FE872 /* Resources */, BECDF62C0761BA81005FE872 /* Sources */, BECDF6680761BA81005FE872 /* Frameworks */, + AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */, ); buildRules = ( ); @@ -2035,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 = ( - 008310461072EA9000A531F1 /* 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 */ @@ -2077,28 +2253,13 @@ targets = ( BECDF5FE0761BA81005FE872 /* Framework */, BECDF66D0761BA81005FE872 /* Static Library */, + DB313F7217554B71006C0E22 /* Shared Library */, BECDF6BB0761BA81005FE872 /* Standard DMG */, - BECDF6C00761BA81005FE872 /* Developer Extras Package */, - 0083103F1072EA5700A531F1 /* Generate Doxygen DocSet */, - 00D8D9EE1195090700638393 /* testsdl */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 00D8D9EB1195090700638393 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 006E94A3119511A1001DE610 /* icon.bmp in Resources */, - 006E94A4119511A1001DE610 /* moose.dat in Resources */, - 006E94A5119511A1001DE610 /* picture.xbm in Resources */, - 006E94A7119511A1001DE610 /* sample.bmp in Resources */, - 006E94A8119511A1001DE610 /* sample.wav in Resources */, - 006E94A9119511A1001DE610 /* utf8.txt in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; BECDF62A0761BA81005FE872 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2116,21 +2277,29 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DB31407317554B71006C0E22 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXRezBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0083103E1072EA5700A531F1 /* ShellScript */ = { + AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); + name = "Sign Frameworks"; 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"; + 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; @@ -2139,38 +2308,11 @@ ); 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`xcode-select -print-path`/Tools/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\ncp pkg-support/resources/ReadMeDevLite.txt 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 \"{}\" \\;\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"; - }; - 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\n#mkdir -p build/devel-extras-tmp/SDLMain\n#mkdir -p build/devel-extras-tmp/SDLMain/NIBless\n#mkdir -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\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\n#cp pkg-support/resources/ReadMeDevLite.txt build/devel-extras-tmp/SDLMain/NIBless\n#cp ../../src/main/macosx/SDLMain.h build/devel-extras-tmp/SDLMain/NIBless\n#cp ../../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 */ /* Begin PBXSourcesBuildPhase section */ - 00D8D9EC1195090700638393 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 00D8DA1B1195093100638393 /* audio.c in Sources */, - 00D8DA1C1195093100638393 /* common.c in Sources */, - 00D8DA221195093100638393 /* platform.c in Sources */, - 00D8DA241195093100638393 /* rect.c in Sources */, - 00D8DA251195093100638393 /* render.c in Sources */, - 00D8DA271195093100638393 /* rwops.c in Sources */, - 00D8DA281195093100638393 /* SDL_at.c in Sources */, - 00D8DA291195093100638393 /* surface.c in Sources */, - 00D8DA2A1195093100638393 /* testsdl.c in Sources */, - 001E39EE1196F75000A3F5B8 /* TestSupportRWops_Cocoa.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; BECDF62C0761BA81005FE872 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2206,7 +2348,6 @@ 04BD009612E6671800899322 /* SDL_power.c in Sources */, 04BD009C12E6671800899322 /* SDL_assert.c in Sources */, 04BD009F12E6671800899322 /* SDL_error.c in Sources */, - 04BD00A012E6671800899322 /* SDL_fatal.c in Sources */, 04BD00A212E6671800899322 /* SDL.c in Sources */, 04BD00A312E6671800899322 /* SDL_getenv.c in Sources */, 04BD00A412E6671800899322 /* SDL_iconv.c in Sources */, @@ -2284,6 +2425,8 @@ 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; }; @@ -2324,7 +2467,6 @@ 04BD02B012E6671800899322 /* SDL_power.c in Sources */, 04BD02B612E6671800899322 /* SDL_assert.c in Sources */, 04BD02B912E6671800899322 /* SDL_error.c in Sources */, - 04BD02BA12E6671800899322 /* SDL_fatal.c in Sources */, 04BD02BC12E6671800899322 /* SDL.c in Sources */, 04BD02BD12E6671800899322 /* SDL_getenv.c in Sources */, 04BD02BE12E6671800899322 /* SDL_iconv.c in Sources */, @@ -2400,22 +2542,131 @@ 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; + }; + DB313FFD17554B71006C0E22 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 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 */ - 008310461072EA9000A531F1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 0083103F1072EA5700A531F1 /* Generate Doxygen DocSet */; - targetProxy = 008310451072EA9000A531F1 /* PBXContainerItemProxy */; - }; - 00D8DA2F1195094500638393 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BECDF5FE0761BA81005FE872 /* Framework */; - targetProxy = 00D8DA2E1195094500638393 /* PBXContainerItemProxy */; - }; BECDF6C60761BA81005FE872 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = BECDF5FE0761BA81005FE872 /* Framework */; @@ -2424,24 +2675,6 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 008310421072EA5700A531F1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DOXYGEN_EXE = /Applications/Doxygen.app/Contents/Resources/doxygen; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - PRODUCT_NAME = "Generate Doxygen DocSet"; - }; - name = Debug; - }; - 008310431072EA5700A531F1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DOXYGEN_EXE = /Applications/Doxygen.app/Contents/Resources/doxygen; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - PRODUCT_NAME = "Generate Doxygen DocSet"; - }; - name = Release; - }; 00CFA621106A567900758660 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2467,7 +2700,7 @@ FRAMEWORK_VERSION = A; HEADER_SEARCH_PATHS = /usr/X11R6/include; INFOPLIST_FILE = "Info-Framework.plist"; - INSTALL_PATH = "@executable_path/../Frameworks"; + INSTALL_PATH = "@rpath"; OTHER_LDFLAGS = "-liconv"; PRODUCT_NAME = SDL2; WRAPPER_EXTENSION = framework; @@ -2498,13 +2731,6 @@ }; name = Release; }; - 00CFA626106A567900758660 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "Developer Extras Package"; - }; - name = Release; - }; 00CFA627106A568900758660 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2528,7 +2754,7 @@ FRAMEWORK_VERSION = A; HEADER_SEARCH_PATHS = /usr/X11R6/include; INFOPLIST_FILE = "Info-Framework.plist"; - INSTALL_PATH = "@executable_path/../Frameworks"; + INSTALL_PATH = "@rpath"; OTHER_LDFLAGS = "-liconv"; PRODUCT_NAME = SDL2; WRAPPER_EXTENSION = framework; @@ -2559,38 +2785,41 @@ }; name = Debug; }; - 00CFA62C106A568900758660 /* Debug */ = { + DB31407517554B71006C0E22 /* Debug */ = { 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; }; - 00D8D9F41195090800638393 /* Debug */ = { + DB31407617554B71006C0E22 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "testsdl-Info.plist"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, + 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)", ); - PRODUCT_NAME = testsdl; - }; - name = Debug; - }; - 00D8D9F51195090800638393 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "testsdl-Info.plist"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PRODUCT_NAME = testsdl; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = /usr/X11R6/include; + INSTALL_PATH = "@rpath"; + PRODUCT_NAME = SDL2; + SKIP_INSTALL = YES; }; name = Release; }; @@ -2624,15 +2853,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 0073178A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Developer Extras Package" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00CFA62C106A568900758660 /* Debug */, - 00CFA626106A567900758660 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; 0073178E0858DB0500B2BC32 /* Build configuration list for PBXProject "SDL" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -2642,20 +2862,11 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 008310471072EAAE00A531F1 /* Build configuration list for PBXAggregateTarget "Generate Doxygen DocSet" */ = { + DB31407417554B71006C0E22 /* Build configuration list for PBXNativeTarget "Shared Library" */ = { isa = XCConfigurationList; buildConfigurations = ( - 008310421072EA5700A531F1 /* Debug */, - 008310431072EA5700A531F1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; - 00D8D9F71195090900638393 /* Build configuration list for PBXNativeTarget "testsdl" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00D8D9F41195090800638393 /* Debug */, - 00D8D9F51195090800638393 /* 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 348b80734..000000000 --- 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. - We also include 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/Application - - - 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 698f1d603..000000000 --- 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 ca37a7f16..f08facd23 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 000000000..16dea2519 --- /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 f4fe36164..000000000 --- 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 9b0d2862f..000000000 --- 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 e7a4dedff..000000000 --- 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/ReadMe.txt b/Xcode/SDL/pkg-support/resources/ReadMe.txt index f5c3b9ffc..40ac3a14c 100755 --- a/Xcode/SDL/pkg-support/resources/ReadMe.txt +++ b/Xcode/SDL/pkg-support/resources/ReadMe.txt @@ -19,12 +19,6 @@ 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: diff --git a/Xcode/SDL/pkg-support/resources/ReadMeDevLite.txt b/Xcode/SDL/pkg-support/resources/ReadMeDevLite.txt deleted file mode 100644 index f1831a606..000000000 --- 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 Project Builder/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 Project Builder/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/testsdl-Info.plist b/Xcode/SDL/testsdl-Info.plist deleted file mode 100644 index 88ac6abca..000000000 --- a/Xcode/SDL/testsdl-Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj index 78e73b472..bb4714de2 100755 --- a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +++ b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj @@ -780,20 +780,6 @@ remoteGlobalIDString = BECDF6BE0761BA81005FE872; remoteInfo = "Standard DMG"; }; - 003FA64A093FFD41000C53B3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BECDF6C30761BA81005FE872; - remoteInfo = "Devel Extras Package"; - }; - 4537747F120914AE002F0F45 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 00D8D9EF1195090700638393; - remoteInfo = testsdl; - }; DB166D6D16A1CEAA00A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; @@ -878,6 +864,13 @@ remoteGlobalIDString = DB166E8016A1D78C00A1396C; remoteInfo = teststreaming; }; + DB1D40D617B3F30D00D74CFC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = DB31407717554B71006C0E22; + remoteInfo = "Shared Library"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -991,13 +984,13 @@ 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 = text; path = testgl2; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = text; path = testhaptic; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = text; path = testime; sourceTree = BUILT_PRODUCTS_DIR; }; + 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; }; @@ -1056,13 +1049,13 @@ 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 = text; path = testgamecontroller; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC566B60761D90300A33029 /* checkkeys */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = checkkeys; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = text; path = testjoystick; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567480761D90400A33029 /* testkeys */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testkeys; 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; }; @@ -1848,9 +1841,8 @@ children = ( 003FA643093FFD41000C53B3 /* SDL2.framework */, 003FA645093FFD41000C53B3 /* libSDL2.a */, + DB1D40D717B3F30D00D74CFC /* libSDL2.dylib */, 003FA649093FFD41000C53B3 /* Standard DMG */, - 003FA64B093FFD41000C53B3 /* Developer Extras Package */, - 45377480120914AE002F0F45 /* testsdl.app */, ); name = Products; sourceTree = ""; @@ -2800,18 +2792,11 @@ 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 */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 45377480120914AE002F0F45 /* testsdl.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = testsdl.app; - remoteRef = 4537747F120914AE002F0F45 /* PBXContainerItemProxy */; + fileType = "compiled.mach-o.dylib"; + path = libSDL2.dylib; + remoteRef = DB1D40D617B3F30D00D74CFC /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -4323,6 +4308,7 @@ DB166D8216A1D12400A1396C /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; DB166DBC16A1D2F600A1396C /* Build configuration list for PBXNativeTarget "testgesture" */ = { isa = XCConfigurationList; 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 6e721b0ef..000000000 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 e4332041b..000000000 --- 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/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074a..000000000 --- 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 ae0b02b12..000000000 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 d9ca45493..000000000 --- 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 7179f5254..000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,304 +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 */; }; - 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 = ""; }; - 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 = ( - ); - 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 = ( - 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_C_LANGUAGE_STANDARD = c99; - 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_C_LANGUAGE_STANDARD = c99; - 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 7115de989..000000000 --- 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 6e721b0ef..000000000 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 799eaaddd..000000000 --- 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 1d6fb7e01..000000000 --- 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 637801528..000000000 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 40a970f97..000000000 --- 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/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074a..000000000 --- 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 ae0b02b12..000000000 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 1dcbea207..000000000 --- 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 e259c6102..000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,316 +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 */; }; - 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 = ""; }; - 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 = ( - ); - 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 = ( - 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_C_LANGUAGE_STANDARD = c99; - 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_C_LANGUAGE_STANDARD = c99; - 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 7115de989..000000000 --- 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 6e721b0ef..000000000 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 a2e942960..000000000 --- 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/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074a..000000000 --- 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 ae0b02b12..000000000 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 ba87745fc..000000000 --- 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 d81bb862e..000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,346 +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 */; }; - 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 = ""; }; - 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 = ( - ); - 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 = ( - 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_C_LANGUAGE_STANDARD = c99; - 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_C_LANGUAGE_STANDARD = c99; - 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 4efdf6ce8..000000000 --- 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 6ccf2d5f0..000000000 --- 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 9fba3ba98..000000000 --- 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 9c847dbaf..000000000 --- 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 cac7b6095..000000000 --- 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 828640ad0..000000000 --- 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 b7794b3b6..000000000 --- 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 6e721b0ef..000000000 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 e4332041b..000000000 --- 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/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074a..000000000 --- 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 ae0b02b12..000000000 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 d9ca45493..000000000 --- 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 0d84f2bca..000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,306 +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 */; }; - 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 = ""; }; - 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 = ( - ); - 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 = ( - 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_C_LANGUAGE_STANDARD = c99; - 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_C_LANGUAGE_STANDARD = c99; - 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 7115de989..000000000 --- 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 6e721b0ef..000000000 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 799eaaddd..000000000 --- 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 1d6fb7e01..000000000 --- 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 637801528..000000000 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 40a970f97..000000000 --- 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/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074a..000000000 --- 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 ae0b02b12..000000000 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 1dcbea207..000000000 --- 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 55ae3aef0..000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,318 +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 */; }; - 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 = ""; }; - 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 = ( - ); - 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 = ( - 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_C_LANGUAGE_STANDARD = c99; - 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_C_LANGUAGE_STANDARD = c99; - 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 7115de989..000000000 --- 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 6e721b0ef..000000000 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 a2e942960..000000000 --- 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/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074a..000000000 --- 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 ae0b02b12..000000000 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 ba87745fc..000000000 --- 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 09373d1ae..000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,348 +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 */; }; - 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 = ""; }; - 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 = ( - ); - 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 = ( - 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_C_LANGUAGE_STANDARD = c99; - 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_C_LANGUAGE_STANDARD = c99; - 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 4efdf6ce8..000000000 --- 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 6ccf2d5f0..000000000 --- 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 9fba3ba98..000000000 --- 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 9c847dbaf..000000000 --- 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 cac7b6095..000000000 --- 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 828640ad0..000000000 --- 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 1ef49c0c9..000000000 --- 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 38224b5a6..000000000 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 c678d1145..000000000 --- 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 d9ca45493..000000000 --- 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 2bb59b5de..000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,297 +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 */; }; - 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 = ""; }; - 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 = ( - ); - 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 "SDLApp" */; - 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 = ( - 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 00095074a..000000000 --- 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/main.c b/Xcode/TemplatesForXcodeTiger/SDL Application/main.c deleted file mode 100644 index 7115de989..000000000 --- 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 38224b5a6..000000000 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 799eaaddd..000000000 --- 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 1d6fb7e01..000000000 --- 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 637801528..000000000 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 c678d1145..000000000 --- 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 00095074a..000000000 --- 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 1dcbea207..000000000 --- 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 d4bc28197..000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,309 +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 */; }; - 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 = ""; }; - 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 = ( - ); - 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 "SDLCocoaApp" */; - 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 = ( - 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/main.c b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/main.c deleted file mode 100644 index 7115de989..000000000 --- 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 38224b5a6..000000000 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 c678d1145..000000000 --- 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 00095074a..000000000 --- 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/SDLOpenGLApp.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/TemplateInfo.plist deleted file mode 100644 index ba87745fc..000000000 --- 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 0c03c9a35..000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,335 +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 */; }; - 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 = ""; }; - 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 = ( - ); - 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 "SDLOpenGLApp" */; - 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 = ( - 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 4efdf6ce8..000000000 --- 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 6ccf2d5f0..000000000 --- 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 9fba3ba98..000000000 --- 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 9c847dbaf..000000000 --- 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 cac7b6095..000000000 --- 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 828640ad0..000000000 --- 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 b7794b3b6..000000000 --- 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/package b/Xcode/package deleted file mode 100755 index 6e6b5707c..000000000 --- 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 ba5a38551..000000000 --- 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 aab8d790f..000000000 --- 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/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index 71c3d2be0..000000000 --- a/aclocal.m4 +++ /dev/null @@ -1,9313 +0,0 @@ -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]) -############################################################################## -dnl Configure Paths for Alsa -dnl Some modifications by Richard Boulton -dnl Christopher Lansdown -dnl Jaroslav Kysela -dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp -dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. -dnl enables arguments --with-alsa-prefix= -dnl --with-alsa-enc-prefix= -dnl --disable-alsatest -dnl -dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, -dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. -dnl -AC_DEFUN([AM_PATH_ALSA], -[dnl Save the original CFLAGS, LDFLAGS, and LIBS -alsa_save_CFLAGS="$CFLAGS" -alsa_save_LDFLAGS="$LDFLAGS" -alsa_save_LIBS="$LIBS" -alsa_found=yes - -dnl -dnl Get the cflags and libraries for alsa -dnl -AC_ARG_WITH(alsa-prefix, -[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)], -[alsa_prefix="$withval"], [alsa_prefix=""]) - -AC_ARG_WITH(alsa-inc-prefix, -[ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)], -[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) - -dnl FIXME: this is not yet implemented -AC_ARG_ENABLE(alsatest, -[ --disable-alsatest Do not try to compile and run a test Alsa program], -[enable_alsatest="$enableval"], -[enable_alsatest=yes]) - -dnl Add any special include directories -AC_MSG_CHECKING(for ALSA CFLAGS) -if test "$alsa_inc_prefix" != "" ; then - ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" - CFLAGS="$CFLAGS -I$alsa_inc_prefix" -fi -AC_MSG_RESULT($ALSA_CFLAGS) - -dnl add any special lib dirs -AC_MSG_CHECKING(for ALSA LDFLAGS) -if test "$alsa_prefix" != "" ; then - ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" - LDFLAGS="$LDFLAGS $ALSA_LIBS" -fi - -dnl add the alsa library -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" -AC_MSG_RESULT($ALSA_LIBS) - -dnl Check for a working version of libasound that is of the right version. -min_alsa_version=ifelse([$1], ,0.1.1,$1) -AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version) -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_LANG_SAVE -AC_LANG_C -AC_TRY_COMPILE([ -#include -], [ -/* 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); -], - [AC_MSG_RESULT(found.)], - [AC_MSG_RESULT(not present.) - ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) - alsa_found=no] -) -AC_LANG_RESTORE - -dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. -if test "x$enable_alsatest" = "xyes"; then -AC_CHECK_LIB([asound], [snd_ctl_open],, - [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) - alsa_found=no] -) -fi - -if test "x$alsa_found" = "xyes" ; then - ifelse([$2], , :, [$2]) - LIBS=`echo $LIBS | sed 's/-lasound//g'` - LIBS=`echo $LIBS | sed 's/ //'` - LIBS="-lasound $LIBS" -fi -if test "x$alsa_found" = "xno" ; then - ifelse([$3], , :, [$3]) - CFLAGS="$alsa_save_CFLAGS" - LDFLAGS="$alsa_save_LDFLAGS" - LIBS="$alsa_save_LIBS" - ALSA_CFLAGS="" - ALSA_LIBS="" -fi - -dnl That should be it. Now just export out symbols: -AC_SUBST(ALSA_CFLAGS) -AC_SUBST(ALSA_LIBS) -]) -# =========================================================================== -# 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 -# =========================================================================== -# 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 -]) -# =========================================================================== -# 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]) -]) -############################################################################## -# -# --- esd.m4 --- -# -# Configure paths for ESD -# Manish Singh 98-9-30 -# stolen back from Frank Belew -# stolen from Manish Singh -# Shamelessly stolen from Owen Taylor - -dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS -dnl -AC_DEFUN([AM_PATH_ESD], -[dnl -dnl Get the cflags and libraries from the esd-config script -dnl -AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], - esd_prefix="$withval", esd_prefix="") -AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], - esd_exec_prefix="$withval", esd_exec_prefix="") -AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], - , enable_esdtest=yes) - - 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 - - AC_PATH_PROG(ESD_CONFIG, esd-config, no) - min_esd_version=ifelse([$1], ,0.2.7,$1) - AC_MSG_CHECKING(for ESD - version >= $min_esd_version) - 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" -dnl -dnl Now check if the installed ESD is sufficiently new. (Also sanity -dnl checks the results of esd-config to some extent -dnl - rm -f conf.esdtest - AC_TRY_RUN([ -#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; - } -} - -],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_esd" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - 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" - AC_TRY_LINK([ -#include -#include -], [ return 0; ], - [ 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"], - [ 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" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - ESD_CFLAGS="" - ESD_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(ESD_CFLAGS) - AC_SUBST(ESD_LIBS) - rm -f conf.esdtest -]) -############################################################################## -# 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, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# 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. - -m4_define([_LT_COPYING], [dnl -# 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. -]) - -# serial 57 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -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 -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -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]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; 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-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -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 -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_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 -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl - -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 - -_LT_CC_BASENAME([$compiler]) - -# 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 - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_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' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - -## ------------------------------------- ## -## Accumulate code for creating libtool. ## -## ------------------------------------- ## - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - -## ------------------------ ## -## FIXME: Eliminate VARNAME ## -## ------------------------ ## - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# 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 "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$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)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# 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' -_LT_CONFIG_STATUS_DECLARATIONS -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 \\\\""\\\\\$\$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 lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); 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 - -_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 -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -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) 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." - -while test $[#] != 0 -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# 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. -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 - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [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. -# -_LT_COPYING -_LT_LIBTOOL_TAGS - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### 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 - - _LT_PROG_LTMAIN - - # 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) - - _LT_PROG_REPLACE_SHELLFNS - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -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)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _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], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(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)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -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 -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# 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 -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -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* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -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* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [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" >&AS_MESSAGE_LOG_FD - $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 >&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 - fi - 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 - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [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' ;; - 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 -]) - - -# _LT_DARWIN_LINKER_FEATURES([TAG]) -# --------------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - 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 - 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 - _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}" - _LT_TAGVAR(module_expsym_cmds, $1)="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}" - m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$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}" - _LT_TAGVAR(archive_expsym_cmds, $1)="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 - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _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 -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], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# 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], -[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 - # 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*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac - -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" )])]) - -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_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], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -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 AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - 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 AC_TRY_EVAL(ac_compile); 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" -])# _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], -[_LT_PROG_AR - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# 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 -_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 - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # 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\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&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 "$_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 - fi - fi - $RM conftest* -]) - -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - 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>&AS_MESSAGE_LOG_FD - $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 - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - 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 -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -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 AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -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 - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) - ]) - ]) - ]) - ]) - ]) - ;; - 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" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - 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 -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=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\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&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 "$_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 - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $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* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - 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 - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[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]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != 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, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = 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 -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -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" - AC_MSG_RESULT([yes]) -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" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -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], - [], [ -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}' -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}' - ;; - 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`' -m4_if([$1], [],[ - 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 - 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 - # 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 -AC_MSG_RESULT([$dynamic_linker]) -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 - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[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]]) -_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], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program which can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[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 -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - 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]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program which can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -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], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - 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 - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[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 &1 /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 -]) - -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 - -_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"]) -_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 - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[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]) -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 - 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" - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_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:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&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:$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" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -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' - -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* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - 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, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -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 -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# 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 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 - # 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@&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 - -_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@&t@_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_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_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - 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 -]) -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 - AC_MSG_RESULT(failed) -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], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_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 - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-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 - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # 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. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-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_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--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). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+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_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-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_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - 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' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *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)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - 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' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-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 - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _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 - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _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 - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-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). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - 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,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - 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,' - ;; - *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' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _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_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. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -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. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -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 -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -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") || (\$ 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*) - 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 -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # 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'. - _LT_TAGVAR(exclude_expsyms, $1)=['_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. -dnl Note also adjust exclude_expsyms for C++ above. - 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 - - _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}' - - # 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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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 - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - 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 - _LT_TAGVAR(ld_shlibs, $1)=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 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$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)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - 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(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/;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' - # 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 $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - 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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _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 | 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 - _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* | 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' ;; - 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 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - 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 - _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; 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 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$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~ - $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 - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _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 - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=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 - _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 - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _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' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _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 - ;; - esac - - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=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 - _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 - 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. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${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 - _LT_TAGVAR(hardcode_direct, $1)=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 - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - 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 - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_TAGVAR(always_export_symbols, $1)=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. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _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 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' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. - _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' - 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' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$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)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-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 - _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*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $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 - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - 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 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _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 - ;; - - hpux9*) - if test "$GCC" = yes; then - _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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - 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_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - 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 $pic_flag ${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}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -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 - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _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. - # 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" && 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' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _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(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" && 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" && 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' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - 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} $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" && 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 "-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' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _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 $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='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='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}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=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 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=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. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _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' - 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. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _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' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_TAGVAR(archive_cmds, $1) 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. - 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 - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_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_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [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]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_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 -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_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_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$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);}' - -_LT_TAG_COMPILER -# 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 -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -## 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_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report which library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - 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 - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC="$lt_save_CC" -])# _LT_LANG_C_CONFIG - - -# _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], -[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 -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_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_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_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 - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$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. - _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_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 - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - 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_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - LT_PATH_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 - _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' - - # 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 - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - 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. - _LT_TAGVAR(archive_cmds, $1)='$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 - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=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. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${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 - _LT_TAGVAR(hardcode_direct, $1)=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 - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - 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 - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_TAGVAR(always_export_symbols, $1)=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. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - _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 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' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. - _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' - 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' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=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. - _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) - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - 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)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=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 - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$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 - _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 - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=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 - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$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*) - _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 $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 $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 - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _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' - ;; - irix5* | irix6*) - 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" && 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. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _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 $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 - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=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. - _LT_TAGVAR(archive_cmds, $1)='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' - _LT_TAGVAR(archive_expsym_cmds, $1)='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"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$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."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$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 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *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 | 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 | 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 | 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 | 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 - _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' - ;; - esac - - _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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # 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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$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~ - $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 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _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; 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='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. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=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*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _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=func_echo_all - else - _LT_TAGVAR(ld_shlibs, $1)=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. - _LT_TAGVAR(archive_cmds, $1)='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' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - 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" && 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" && 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 "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # 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 - _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" && 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 $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 - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # 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 - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - 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' - _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)='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' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=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?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=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. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$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. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - 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 $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 $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. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -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 -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 - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - 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(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - 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' - _LT_TAGVAR(archive_expsym_cmds, $1)='$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 - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$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... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - 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_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 -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# 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)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_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 - # 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 "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${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 "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" - else - _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. - 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 "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[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. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; - -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 - _LT_TAGVAR(postdeps,$1)='-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 - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _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_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)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_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_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_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 - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 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_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # 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_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${F77-"f77"} - CFLAGS=$FFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - 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 - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$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... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - 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_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_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)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_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_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_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 - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC 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_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # 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_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - 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 - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$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... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# 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=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# GCJ 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_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 -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# 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= -CC=${RC-"windres"} -CFLAGS= -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -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], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_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 -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# 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 -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# 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 -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _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=: -]) - - -# _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_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}"}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) - - _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"}]) - - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) - - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) - - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi - -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) - - _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"]) - - # 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 - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) - -# _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 - ;; - *-*-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 -]) -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 -# Helper functions for option handling. -*- Autoconf -*- -# -# 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 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])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - ]) -])# _LT_SET_OPTIONS - - -## --------------------------------- ## -## Macros to handle LT_INIT options. ## -## --------------------------------- ## - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [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], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [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], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [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], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT options. -# 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@<:@=PKGS@:>@], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [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]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - -## ----------------- ## -## LTDL_INIT Options ## -## ----------------- ## - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2008 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 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - 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 -]) -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 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. - -# @configure_input@ - -# serial 3337 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.4.2]) -m4_define([LT_PACKAGE_REVISION], [1.3337]) - -AC_DEFUN([LTVERSION_VERSION], -[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) -]) -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# 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 5 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -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_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])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -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 index ce7c056ae..27db41843 100644 --- a/android-project/AndroidManifest.xml +++ b/android-project/AndroidManifest.xml @@ -15,11 +15,12 @@ then replace "SDLActivity" with the name of your class (e.g. "MyGame") in the XML below. - An example Java class can be found in README.android + An example Java class can be found in README-android.txt --> + android:allowBackup="true" + android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> @@ -30,7 +31,7 @@ - + diff --git a/android-project/jni/src/Android.mk b/android-project/jni/src/Android.mk index 948be96e5..70ca7dc35 100644 --- a/android-project/jni/src/Android.mk +++ b/android-project/jni/src/Android.mk @@ -9,7 +9,7 @@ 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.cpp \ +LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \ YourSourceHere.c LOCAL_SHARED_LIBRARIES := SDL2 diff --git a/android-project/src/org/libsdl/app/SDLActivity.java b/android-project/src/org/libsdl/app/SDLActivity.java index 93a5fedec..ed6f4ef32 100644 --- a/android-project/src/org/libsdl/app/SDLActivity.java +++ b/android-project/src/org/libsdl/app/SDLActivity.java @@ -3,8 +3,8 @@ 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.opengles.GL10; -import javax.microedition.khronos.egl.*; +import javax.microedition.khronos.egl.EGLDisplay; +import javax.microedition.khronos.egl.EGLSurface; import android.app.*; import android.content.*; @@ -17,53 +17,51 @@ import android.widget.AbsoluteLayout; import android.os.*; import android.util.Log; import android.graphics.*; -import android.text.method.*; -import android.text.*; import android.media.*; import android.hardware.*; -import android.content.*; - -import java.lang.*; /** SDL Activity */ public class SDLActivity extends Activity { + private static final String TAG = "SDL"; // Keep track of the paused state - public static boolean mIsPaused = false; + public static boolean mIsPaused = false, mIsSurfaceReady = false, mHasFocus = true; // Main components - private static SDLActivity mSingleton; - private static SDLSurface mSurface; - private static View mTextEdit; - private static ViewGroup mLayout; + 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 - private static Thread mSDLThread; + protected static Thread mSDLThread; // Audio - private static Thread mAudioThread; - private static AudioTrack mAudioTrack; + protected static Thread mAudioThread; + protected static AudioTrack mAudioTrack; - // EGL private objects - private static EGLContext mEGLContext; - private static EGLSurface mEGLSurface; - private static EGLDisplay mEGLDisplay; - private static EGLConfig mEGLConfig; - private static int mGLMajor, mGLMinor; + // 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); @@ -72,29 +70,51 @@ public class SDLActivity extends Activity { 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); - - SurfaceHolder holder = mSurface.getHolder(); } // Events - /*protected void onPause() { + @Override + protected void onPause() { Log.v("SDL", "onPause()"); super.onPause(); - // Don't call SDLActivity.nativePause(); here, it will be called by SDLSurface::surfaceDestroyed + SDLActivity.handlePause(); } + @Override protected void onResume() { Log.v("SDL", "onResume()"); super.onResume(); - // Don't call SDLActivity.nativeResume(); here, it will be called via SDLSurface::surfaceChanged->SDLActivity::startApp - }*/ + 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()"); @@ -114,96 +134,163 @@ public class SDLActivity extends Activity { } } + @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; - // Handler for the messages - Handler commandHandler = new Handler() { + 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: - setTitle((String)msg.obj); + 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) getSystemService(Context.INPUT_METHOD_SERVICE); + 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 - void sendCommand(int command, Object data) { + boolean sendCommand(int command, Object data) { Message msg = commandHandler.obtainMessage(); msg.arg1 = command; msg.obj = data; - commandHandler.sendMessage(msg); + 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); - public static native void nativeRunAudioThread(); - // 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 void setActivityTitle(String title) { + public static boolean setActivityTitle(String title) { // Called from SDLMain() thread and can't directly affect the view - mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title); + return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title); } - public static void sendMessage(int command, int param) { - mSingleton.sendCommand(command, Integer.valueOf(param)); + public static boolean sendMessage(int command, int param) { + return mSingleton.sendCommand(command, Integer.valueOf(param)); } public static Context getContext() { return mSingleton; } - public static void startApp() { - // Start up the C app thread - if (mSDLThread == null) { - mSDLThread = new Thread(new SDLMain(), "SDLThread"); - mSDLThread.start(); - } - else { - /* - * Some Android variants may send multiple surfaceChanged events, so we don't need to resume every time - * every time we get one of those events, only if it comes after surfaceDestroyed - */ - if (mIsPaused) { - SDLActivity.nativeResume(); - SDLActivity.mIsPaused = false; - } - } - } - - static class ShowTextInputHandler implements Runnable { + 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 @@ -213,13 +300,14 @@ public class SDLActivity extends Activity { public int x, y, w, h; - public ShowTextInputHandler(int x, int y, int w, int 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); @@ -238,41 +326,74 @@ public class SDLActivity extends Activity { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(mTextEdit, 0); } - } - public static void showTextInput(int x, int y, int w, int h) { + public static boolean showTextInput(int x, int y, int w, int h) { // Transfer the task to the main thread as a Runnable - mSingleton.commandHandler.post(new ShowTextInputHandler(x, y, w, h)); + 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) { - Log.v("SDL", "Starting up OpenGL ES " + majorVersion + "." + minorVersion); - - EGL10 egl = (EGL10)EGLContext.getEGL(); - - EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); - + SDLActivity.mEGLDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); int[] version = new int[2]; - egl.eglInitialize(dpy, version); - - EGLConfig[] configs = new EGLConfig[1]; + 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(dpy, attribs, configs, 1, num_config) || num_config[0] == 0) { + 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 = configs[0]; + 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.mEGLDisplay = dpy; SDLActivity.mEGLConfig = config; SDLActivity.mGLMajor = majorVersion; SDLActivity.mGLMinor = minorVersion; } + return SDLActivity.createEGLSurface(); } catch(Exception e) { @@ -299,27 +420,32 @@ public class SDLActivity extends Activity { public static boolean createEGLSurface() { if (SDLActivity.mEGLDisplay != null && SDLActivity.mEGLConfig != null) { EGL10 egl = (EGL10)EGLContext.getEGL(); - if (SDLActivity.mEGLContext == null) createEGLContext(); + if (SDLActivity.mEGLContext == EGL10.EGL_NO_CONTEXT) createEGLContext(); - Log.v("SDL", "Creating new EGL Surface"); - EGLSurface surface = egl.eglCreateWindowSurface(SDLActivity.mEGLDisplay, SDLActivity.mEGLConfig, SDLActivity.mSurface, null); - if (surface == EGL10.EGL_NO_SURFACE) { - Log.e("SDL", "Couldn't create surface"); - return false; + 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, surface, surface, 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, surface, surface, SDLActivity.mEGLContext)) { + 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"); } - SDLActivity.mEGLSurface = surface; + else Log.v("SDL", "EGL Context remains current"); + return true; } else { Log.e("SDL", "Surface creation failed, display = " + SDLActivity.mEGLDisplay + ", config = " + SDLActivity.mEGLConfig); @@ -350,37 +476,38 @@ public class SDLActivity extends Activity { } // Audio - public static void audioInit(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) { + 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") + " " + ((float)sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer"); + 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); - mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, - channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM); - - audioStartThread(); - - Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + ((float)mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer"); - } - - public static void audioStartThread() { - mAudioThread = new Thread(new Runnable() { - public void run() { - mAudioTrack.play(); - nativeRunAudioThread(); + 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"); - // I'd take REALTIME if I could get it! - mAudioThread.setPriority(Thread.MAX_PRIORITY); - mAudioThread.start(); + return 0; } public static void audioWriteShortBuffer(short[] buffer) { @@ -413,24 +540,13 @@ public class SDLActivity extends Activity { // Nom nom } } else { - Log.w("SDL", "SDL audio: error return from write(short)"); + Log.w("SDL", "SDL audio: error return from write(byte)"); return; } } } public static void audioQuit() { - if (mAudioThread != null) { - try { - mAudioThread.join(); - } catch(Exception e) { - Log.v("SDL", "Problem stopping audio thread: " + e); - } - mAudioThread = null; - - //Log.v("SDL", "Finished waiting for audio thread"); - } - if (mAudioTrack != null) { mAudioTrack.stop(); mAudioTrack = null; @@ -442,6 +558,7 @@ public class SDLActivity extends Activity { Simple nativeInit() runnable */ class SDLMain implements Runnable { + @Override public void run() { // Runs SDL_main() SDLActivity.nativeInit(); @@ -461,10 +578,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnKeyListener, View.OnTouchListener, SensorEventListener { // Sensors - private static SensorManager mSensorManager; + protected static SensorManager mSensorManager; // Keep track of the surface size to normalize touch events - private static float mWidth, mHeight; + protected static float mWidth, mHeight; // Startup public SDLSurface(Context context) { @@ -477,7 +594,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, setOnKeyListener(this); setOnTouchListener(this); - mSensorManager = (SensorManager)context.getSystemService("sensor"); + mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); // Some arbitrary defaults to avoid a potential division by zero mWidth = 1.0f; @@ -485,23 +602,35 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, } // Called when we have a valid drawing surface + @Override public void surfaceCreated(SurfaceHolder holder) { Log.v("SDL", "surfaceCreated()"); holder.setType(SurfaceHolder.SURFACE_TYPE_GPU); - enableSensor(Sensor.TYPE_ACCELEROMETER, true); + // 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()"); - if (!SDLActivity.mIsPaused) { - SDLActivity.mIsPaused = true; - SDLActivity.nativePause(); - } - enableSensor(Sensor.TYPE_ACCELEROMETER, false); + // 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()"); @@ -551,23 +680,38 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, break; } - mWidth = (float) width; - mHeight = (float) height; + mWidth = width; + mHeight = height; SDLActivity.onNativeResize(width, height, sdlFormat); Log.v("SDL", "Window size:" + width + "x"+height); - SDLActivity.startApp(); + // 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); @@ -583,12 +727,12 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, } // 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 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(); */ @@ -609,7 +753,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, } else { SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p); } - } return true; } @@ -626,10 +769,12 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, } } + @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, @@ -658,6 +803,7 @@ class DummyEdit extends View implements View.OnKeyListener { return true; } + @Override public boolean onKey(View v, int keyCode, KeyEvent event) { // This handles the hardware keyboard input @@ -678,6 +824,23 @@ class DummyEdit extends View implements View.OnKeyListener { 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) { @@ -740,3 +903,4 @@ class SDLInputConnection extends BaseInputConnection { public native void nativeSetComposingText(String text, int newCursorPosition); } + diff --git a/build-scripts/fatbuild.sh b/build-scripts/fatbuild.sh deleted file mode 100755 index 807238f4b..000000000 --- a/build-scripts/fatbuild.sh +++ /dev/null @@ -1,294 +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 - -# 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`/.. -srcdir=`cd $srcdir && pwd` -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-bin) - install_bin="yes" - ;; - install-hdrs) - install_hdrs="yes" - ;; - install-lib) - install_lib="yes" - ;; - install-data) - install_data="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/libSDL2.dylib && - lipo -create -o $output/libSDL2.a */build/.libs/libSDL2.a && - cp $native_path/build/.libs/libSDL2.la $output && - cp $native_path/build/.libs/libSDL2.lai $output && - cp $native_path/build/libSDL2.la . && - lipo -create -o libSDL2main.a */build/libSDL2main.a && - lipo -create -o libSDL2_test.a */build/libSDL2_test.a && - 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/sdl2-config $bindir/sdl2-config -fi -if test x$install_hdrs = xyes; then - do_install sh $auxdir/mkinstalldirs $includedir/SDL2 - for src in $srcdir/include/*.h; do \ - file=`echo $src | sed -e 's|^.*/||'`; \ - do_install /usr/bin/install -c -m 644 $src $includedir/SDL2/$file; \ - done - do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL2/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/libSDL2.la $libdir/libSDL2.la - do_install /usr/bin/install -c -m 644 build/libSDL2main.a $libdir/libSDL2main.a - do_install ranlib $libdir/libSDL2main.a - do_install /usr/bin/install -c -m 644 build/libSDL2_test.a $libdir/libSDL2_test.a - do_install ranlib $libdir/libSDL2_test.a -fi -if test x$install_data = xyes; then - do_install sh $auxdir/mkinstalldirs $datadir/aclocal - do_install /usr/bin/install -c -m 644 $srcdir/sdl2.m4 $datadir/aclocal/sdl2.m4 -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 000000000..6e4f53e7c --- /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 000000000..edabb0d87 --- /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/cmake/macros.cmake b/cmake/macros.cmake index fe712a140..c234a566c 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -63,3 +63,11 @@ macro(LISTTOSTR _LIST _OUTPUT) 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 index 5a9139903..14fb327b1 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -18,10 +18,10 @@ macro(CheckDLOPEN) endif() check_c_source_compiles(" #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 - int main(int argc, char **argv) {}" HAVE_DLOPEN) + int main(int argc, char **argv) { + void *handle = dlopen(\"\", RTLD_NOW); + const char *loaderror = (char *) dlerror(); + }" HAVE_DLOPEN) set(CMAKE_REQUIRED_LIBRARIES) endif() @@ -225,6 +225,37 @@ macro(CheckNAS) 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: @@ -281,8 +312,13 @@ macro(CheckX11) 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) @@ -356,6 +392,14 @@ macro(CheckX11) 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) @@ -449,11 +493,12 @@ endmacro(CheckX11) # macro(CheckCOCOA) if(VIDEO_COCOA) - check_c_source_compiles(" + 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) @@ -658,6 +703,7 @@ macro(CheckPTHREAD) ${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} diff --git a/configure b/configure index b6811fe34..38084c272 100755 --- a/configure +++ b/configure @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ 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 @@ -167,7 +190,8 @@ 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\$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'\" && @@ -220,21 +244,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # 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 - export CONFIG_SHELL - 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+"$@"} + 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 : @@ -336,6 +364,14 @@ $as_echo X"$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 @@ -457,6 +493,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits 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). @@ -491,16 +531,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... 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 -p'. + # 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 -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -512,28 +552,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +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'" @@ -572,7 +592,7 @@ PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= -ac_unique_file="README" +ac_unique_file="README.txt" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -792,6 +812,8 @@ enable_arts enable_arts_shared enable_nas enable_nas_shared +enable_sndio +enable_sndio_shared enable_diskaudio enable_dummyaudio enable_video_x11 @@ -1292,8 +1314,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1491,7 +1511,7 @@ Optional Features: --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=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]] @@ -1506,6 +1526,8 @@ Optional Features: --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]] @@ -1546,7 +1568,7 @@ Optional Features: --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=no]] + UNIX [[default=yes]] --enable-rpath use an rpath when linking SDL [[default=yes]] --enable-render-d3d enable the Direct3D render driver [[default=yes]] @@ -1645,9 +1667,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +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 @@ -1723,7 +1745,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2021,7 +2043,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2237,190 +2259,12 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member - -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 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.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3014,7 +2858,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -3054,7 +2898,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -3107,7 +2951,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -3148,7 +2992,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -3206,7 +3050,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -3250,7 +3094,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -3696,8 +3540,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#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); @@ -3804,7 +3647,7 @@ do 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" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + 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 @@ -3880,7 +3723,7 @@ do 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" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + 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 @@ -3946,7 +3789,7 @@ do 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" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + 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 @@ -4013,7 +3856,7 @@ do 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" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + 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 @@ -4269,7 +4112,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -4313,7 +4156,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -4737,7 +4580,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -4777,7 +4620,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -5082,7 +4925,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -5122,7 +4965,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -5223,7 +5066,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -5267,7 +5110,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -5392,7 +5235,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -5432,7 +5275,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -5491,7 +5334,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -5531,7 +5374,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -5635,7 +5478,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6222,7 +6065,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6262,7 +6105,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6342,7 +6185,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6382,7 +6225,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6434,7 +6277,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6474,7 +6317,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6526,7 +6369,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6566,7 +6409,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6618,7 +6461,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6658,7 +6501,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6710,7 +6553,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -6750,7 +6593,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -7255,7 +7098,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -7295,7 +7138,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -7347,7 +7190,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -7387,7 +7230,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -7439,7 +7282,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -7479,7 +7322,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -11573,7 +11416,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -11613,7 +11456,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -11666,7 +11509,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -11707,7 +11550,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -11765,7 +11608,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -11809,7 +11652,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -12005,8 +11848,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#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); @@ -12119,7 +11961,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -12163,7 +12005,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -15586,7 +15428,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + 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. @@ -15690,7 +15532,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -15730,7 +15572,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -15766,6 +15608,15 @@ else 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" @@ -15775,15 +15626,45 @@ elif test -d .hg; then 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 - BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin" - BASE_LDFLAGS="-mno-cygwin" - ;; - *) - BASE_CFLAGS="" - BASE_LDFLAGS="" + 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 @@ -15825,7 +15706,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 @@ -15844,11 +15725,11 @@ else int main () { -/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus - /* Ultrix mips cc rejects this. */ + /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; - const charset cs; + const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; @@ -15865,8 +15746,9 @@ main () ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; + { /* 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; @@ -15882,10 +15764,10 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this saying + { /* 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]; }; - struct s *b; b->j = 5; + 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; @@ -16418,23 +16300,20 @@ else /* end confdefs.h. */ $ac_includes_default int -find_stack_direction () +find_stack_direction (int *addr, int depth) { - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; + 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 () +main (int argc, char **argv) { - return find_stack_direction () < 0; + return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -16798,39 +16677,6 @@ fi fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 -$as_echo_n "checking size of void*... " >&6; } -if ${ac_cv_sizeof_voidp+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_voidp" = yes; then - { { $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 "cannot compute sizeof (void*) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_voidp=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 -$as_echo "$ac_cv_sizeof_voidp" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOIDP $ac_cv_sizeof_voidp -_ACEOF - - # Check whether --enable-gcc-atomics was given. if test "${enable_gcc_atomics+set}" = set; then : @@ -16917,7 +16763,10 @@ 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" @@ -16997,8 +16846,6 @@ if test x$enable_joystick != xyes; then $as_echo "#define SDL_JOYSTICK_DISABLED 1" >>confdefs.h -else - SOURCES="$SOURCES $srcdir/src/joystick/*.c" fi # Check whether --enable-haptic was given. if test "${enable_haptic+set}" = set; then : @@ -17011,8 +16858,6 @@ if test x$enable_haptic != xyes; then $as_echo "#define SDL_HAPTIC_DISABLED 1" >>confdefs.h -else - SOURCES="$SOURCES $srcdir/src/haptic/*.c" fi # Check whether --enable-power was given. if test "${enable_power+set}" = set; then : @@ -17025,8 +16870,6 @@ if test x$enable_power != xyes; then $as_echo "#define SDL_POWER_DISABLED 1" >>confdefs.h -else - SOURCES="$SOURCES $srcdir/src/power/*.c" fi # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : @@ -17513,9 +17356,21 @@ CheckOSS() if test "${enable_oss+set}" = set; then : enableval=$enable_oss; else - enable_oss=yes + 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; } @@ -17909,7 +17764,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -18159,7 +18014,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -18222,6 +18077,14 @@ 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 @@ -18258,7 +18121,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -18463,6 +18326,112 @@ $as_echo "#define SDL_AUDIO_DRIVER_NAS 1" >>confdefs.h 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. @@ -19391,12 +19360,32 @@ 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 @@ -19465,6 +19454,35 @@ 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 @@ -20184,7 +20202,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -20229,7 +20247,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -20373,7 +20391,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -20770,7 +20788,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 @@ -20902,9 +20920,20 @@ fi pthread_cflags="-D_REENTRANT" pthread_lib="-pthread" ;; - *-*-solaris*) + *-*-solaris2.9) + # From Solaris 9+, posix4's preferred name is rt. pthread_cflags="-D_REENTRANT" - pthread_lib="-lpthread -lposix4" + 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" @@ -21247,6 +21276,9 @@ $as_echo "$has_pthread_set_name_np" >&6; } # 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 @@ -21360,6 +21392,14 @@ if test "x$ac_cv_header_xaudio2_h" = xyes; then : 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 } @@ -21385,9 +21425,8 @@ int main () { - #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(); ; return 0; @@ -21842,7 +21881,7 @@ CheckClockGettime() if test "${enable_clock_gettime+set}" = set; then : enableval=$enable_clock_gettime; else - enable_clock_gettime=no + enable_clock_gettime=yes fi if test x$enable_clock_gettime = xyes; then @@ -21997,6 +22036,7 @@ case "$host" in CheckARTSC CheckESD CheckNAS + CheckSNDIO CheckX11 CheckDirectFB CheckFusionSound @@ -22021,7 +22061,7 @@ $as_echo "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" have_audio=yes ;; - netbsd|openbsd) + netbsd) # Don't use this on OpenBSD, it's busted. $as_echo "#define SDL_AUDIO_DRIVER_BSD 1" >>confdefs.h @@ -22182,9 +22222,7 @@ $as_echo "#define SDL_POWER_WINDOWS 1" >>confdefs.h $as_echo "#define SDL_THREAD_WINDOWS 1" >>confdefs.h - SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_sysmutex.c" - SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_syssem.c" - SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_systhread.c" + SOURCES="$SOURCES $srcdir/src/thread/windows/*.c" SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" have_threads=yes fi @@ -22205,19 +22243,58 @@ $as_echo "#define SDL_LOADSO_WINDOWS 1" >>confdefs.h have_loadso=yes fi # Set up the system libraries we need - # SDL is unicode, and unicows emulates this on Windows 98/ME - # You can get this here: http://libunicows.sourceforge.net/ - #EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lunicows" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lversion -luuid" + 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 -lSDL2main $SDL_LIBS -mwindows" + 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/develop/tools/gnupro + ac_default_prefix=/boot/common CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -22323,7 +22400,6 @@ $as_echo "#define SDL_POWER_BEOS 1" >>confdefs.h fi # The iOS platform requires special setup. SOURCES="$SOURCES $srcdir/src/video/uikit/*.m" - SOURCES="$SOURCES $srcdir/src/video/uikit/*.c" EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation" @@ -22975,16 +23051,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... 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 -p'. + # 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 -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -23044,28 +23120,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# 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'" @@ -23087,7 +23151,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -23153,10 +23217,10 @@ 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.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +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." @@ -23246,7 +23310,7 @@ 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 + 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' @@ -25055,3 +25119,4 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then $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 84444f3e6..252efe4be 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ 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_CONFIG_AUX_DIR(build-scripts) AC_CONFIG_MACRO_DIR([acinclude]) @@ -57,6 +57,16 @@ 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 @@ -67,15 +77,29 @@ elif test -d .hg; then 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="" - 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 # Uncomment the following line if you want to force SDL and applications @@ -119,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 @@ -248,7 +272,7 @@ if test x$enable_libc = xyes; then AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include ]) fi -AC_CHECK_SIZEOF(void*) +dnl AC_CHECK_SIZEOF(void*) dnl See whether we can use gcc atomic operations on this architecture AC_ARG_ENABLE(gcc-atomics, @@ -297,7 +321,10 @@ 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" @@ -342,24 +369,18 @@ 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, 1, [ ]) -else - SOURCES="$SOURCES $srcdir/src/joystick/*.c" fi 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, [ ]) -else - SOURCES="$SOURCES $srcdir/src/haptic/*.c" 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, [ ]) -else - SOURCES="$SOURCES $srcdir/src/power/*.c" fi AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]), @@ -646,8 +667,20 @@ 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 @@ -913,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() { @@ -1099,10 +1178,25 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma CFLAGS="$CFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" + 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 @@ -1144,6 +1238,18 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma ]) 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 @@ -1950,6 +2056,9 @@ 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 fi fi @@ -2004,6 +2113,14 @@ AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[defaul AC_CHECK_HEADER(dsound.h, have_dsound=yes) 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 } @@ -2019,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 ]) @@ -2179,8 +2295,8 @@ 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 @@ -2245,6 +2361,7 @@ case "$host" in CheckARTSC CheckESD CheckNAS + CheckSNDIO CheckX11 CheckDirectFB CheckFusionSound @@ -2267,7 +2384,7 @@ case "$host" in SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" have_audio=yes ;; - netbsd|openbsd) + 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 @@ -2392,9 +2509,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau # Set up files for the thread library if test x$enable_threads = xyes; then AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_sysmutex.c" - SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_syssem.c" - SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_systhread.c" + SOURCES="$SOURCES $srcdir/src/thread/windows/*.c" SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" have_threads=yes fi @@ -2411,19 +2526,25 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau have_loadso=yes fi # Set up the system libraries we need - # SDL is unicode, and unicows emulates this on Windows 98/ME - # You can get this here: http://libunicows.sourceforge.net/ - #EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lunicows" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lversion -luuid" + 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 -lSDL2main $SDL_LIBS -mwindows" + 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 ;; *-*-beos* | *-*-haiku*) ARCH=beos - ac_default_prefix=/boot/develop/tools/gnupro + ac_default_prefix=/boot/common CheckDummyVideo CheckDiskAudio CheckDummyAudio @@ -2517,7 +2638,6 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau fi # The iOS platform requires special setup. SOURCES="$SOURCES $srcdir/src/video/uikit/*.m" - SOURCES="$SOURCES $srcdir/src/video/uikit/*.c" EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation" @@ -2747,3 +2867,4 @@ 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/copyright b/debian/copyright index 09e14f7f5..a53d19be0 100644 --- a/debian/copyright +++ b/debian/copyright @@ -49,22 +49,6 @@ Files: src/video/x11/imKStoUCS.c Copyright: 1994-2003 The XFree86 Project, Inc. License: MIT/X11 -Files: test/test-automation/* -Copyright: 2011 Markus Kauppila -License: zlib/libpng - -Files: test/automated/* - test/test-automation/src/libSDLtest/common/* -Copyright: Edgar Simo "bobbens" -License: PublicDomain_Edgar_Simo - -Files: test/automated/common/im* -Copyright: none -License: zlib/libpng -Comment: - Auto-generated code from images, no specific information about the original - image - Files: test/testhaptic.c Copyright: 1997-2011 Sam Lantinga 2008 Edgar Simo Serra @@ -75,10 +59,6 @@ Copyright: 1997-2011 Sam Lantinga 2011 Edgar Simo Serra License: BSD_3_clause -Files: test/test-automation/src/libSDLtest/fuzzer/utl_md5.* -Copyright: 1990-1991 RSA Data Security, Inc. -License: RSA_Data_Security - Files: test/shapes/* Copyright: none License: zlib/libpng diff --git a/debian/docs b/debian/docs index c7f962913..2e2e9c4ee 100644 --- a/debian/docs +++ b/debian/docs @@ -1,4 +1,4 @@ -BUGS -CREDITS -README +BUGS.txt +CREDITS.txt +README.txt README-SDL.txt diff --git a/include/SDL.h b/include/SDL.h index 0cfcdc71a..f2d760c2e 100644 --- a/include/SDL.h +++ b/include/SDL.h @@ -21,42 +21,42 @@ /** * \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/ - * + * 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 - * + * http://www.libsdl.org/mailing-list.php + * * Enjoy! - * Sam Lantinga (slouken@libsdl.org) + * Sam Lantinga (slouken@libsdl.org) */ #ifndef _SDL_H @@ -92,29 +92,28 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* As of version 0.5, SDL is loaded dynamically into the application */ /** * \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_JOYSTICK 0x00000200 +#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 /**< turn on game controller also implicitly does JOYSTICK */ -#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ +#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_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \ ) /*@}*/ @@ -139,7 +138,7 @@ extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); /** * 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); @@ -152,9 +151,7 @@ extern DECLSPEC void SDLCALL SDL_Quit(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_assert.h b/include/SDL_assert.h index e4620aee2..5a6afc5e2 100644 --- a/include/SDL_assert.h +++ b/include/SDL_assert.h @@ -27,9 +27,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif #ifndef SDL_ASSERT_LEVEL @@ -187,7 +185,7 @@ typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)( * 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. */ @@ -230,9 +228,7 @@ extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_atomic.h b/include/SDL_atomic.h index be60f9916..7bd669d1a 100644 --- a/include/SDL_atomic.h +++ b/include/SDL_atomic.h @@ -21,30 +21,31 @@ /** * \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 + * 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 @@ -72,14 +73,12 @@ /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #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 @@ -98,7 +97,7 @@ 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. @@ -107,7 +106,7 @@ 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); @@ -137,6 +136,52 @@ void _ReadWriteBarrier(void); { 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 */ @@ -304,9 +349,7 @@ SDL_FORCE_INLINE void* SDL_AtomicGetPtr(void* *a) /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_audio.h b/include/SDL_audio.h index 8a1bb7067..0b6f28af6 100644 --- a/include/SDL_audio.h +++ b/include/SDL_audio.h @@ -21,7 +21,7 @@ /** * \file SDL_audio.h - * + * * Access to the raw audio mixing buffer for the SDL library. */ @@ -38,17 +38,15 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * \brief Audio format flags. - * + * * These are what the 16 bits in SDL_AudioFormat currently mean... * (Unspecified bits are always zero). - * + * * \verbatim ++-----------------------sample is signed if set || @@ -60,7 +58,7 @@ extern "C" { || || || | | 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 Uint16 SDL_AudioFormat; @@ -82,42 +80,38 @@ typedef Uint16 SDL_AudioFormat; #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 +#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 - * - * New to SDL 1.3. */ /*@{*/ -#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ -#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ -#define AUDIO_S32 AUDIO_S32LSB +#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 float32 support - * - * New to SDL 1.3. */ /*@{*/ -#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 +#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 /*@}*/ /** @@ -125,21 +119,21 @@ typedef Uint16 SDL_AudioFormat; */ /*@{*/ #if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define AUDIO_U16SYS AUDIO_U16LSB -#define AUDIO_S16SYS AUDIO_S16LSB -#define AUDIO_S32SYS AUDIO_S32LSB -#define AUDIO_F32SYS AUDIO_F32LSB +#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_S32SYS AUDIO_S32MSB -#define AUDIO_F32SYS AUDIO_F32MSB +#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. */ /*@{*/ @@ -189,6 +183,17 @@ typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, /** * 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 */ @@ -202,14 +207,14 @@ typedef struct SDL_AudioCVT 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; +} SDL_AUDIOCVT_PACKED SDL_AudioCVT; /* Function prototypes */ /** * \name Driver discovery functions - * + * * These functions return the list of built in audio drivers, in the * order that they are normally initialized by default. */ @@ -220,9 +225,9 @@ 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 + * you have a specific need to specify the audio driver you want to * use. You should normally use SDL_Init() or SDL_InitSubSystem(). */ /*@{*/ @@ -242,20 +247,20 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); * 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 + * 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 + * - \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 + * 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 @@ -271,7 +276,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); * 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 @@ -283,7 +288,7 @@ extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, /** * 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 @@ -299,7 +304,7 @@ typedef Uint32 SDL_AudioDeviceID; * 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()). @@ -313,7 +318,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); * 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 @@ -326,14 +331,14 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, /** * 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 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. - * + * * \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 SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char @@ -351,7 +356,7 @@ extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char /** * \name Audio state - * + * * Get the current audio state. */ /*@{*/ @@ -369,7 +374,7 @@ SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); /** * \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 @@ -387,18 +392,18 @@ extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, * 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, ...); + * 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 * \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 + * 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 + * 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, @@ -407,12 +412,12 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, Uint8 ** audio_buf, Uint32 * audio_len); -/** +/** * 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() @@ -424,7 +429,7 @@ extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); * 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 -1 if the format conversion is not supported, 0 if there's * no conversion needed, or 1 if the audio filter is set up. */ @@ -441,7 +446,7 @@ extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, * 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. @@ -471,9 +476,9 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, /** * \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 + * 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. */ @@ -490,17 +495,9 @@ extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); extern DECLSPEC void SDLCALL SDL_CloseAudio(void); extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); -/** - * \return 1 if audio device is still functioning, zero if not, -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_AudioDeviceConnected(SDL_AudioDeviceID dev); - - /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_bits.h b/include/SDL_bits.h index d678b7822..b1ed20bf7 100644 --- a/include/SDL_bits.h +++ b/include/SDL_bits.h @@ -33,9 +33,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -47,15 +45,18 @@ extern "C" { * with 0. This operation can also be stated as "count leading zeroes" and * "log base 2". * - * \return Index of the most significant bit. + * \return Index of the most significant bit, or -1 if the value is 0. */ -SDL_FORCE_INLINE Sint8 +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 @@ -63,11 +64,15 @@ SDL_MostSignificantBitIndex32(Uint32 x) * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog */ const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; - const Uint8 S[] = {1, 2, 4, 8, 16}; + const int S[] = {1, 2, 4, 8, 16}; - Uint8 msbIndex = 0; + int msbIndex = 0; int i; + if (x == 0) { + return -1; + } + for (i = 4; i >= 0; i--) { if (x & b[i]) @@ -83,9 +88,7 @@ SDL_MostSignificantBitIndex32(Uint32 x) /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_blendmode.h b/include/SDL_blendmode.h index 64a3530e3..85aa47459 100644 --- a/include/SDL_blendmode.h +++ b/include/SDL_blendmode.h @@ -21,7 +21,7 @@ /** * \file SDL_blendmode.h - * + * * Header file declaring the SDL_BlendMode enumeration */ @@ -31,9 +31,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -41,17 +39,22 @@ extern "C" { */ typedef enum { - SDL_BLENDMODE_NONE = 0x00000000, /**< No blending */ - SDL_BLENDMODE_BLEND = 0x00000001, /**< dst = (src * A) + (dst * (1-A)) */ - SDL_BLENDMODE_ADD = 0x00000002, /**< dst = (src * A) + dst */ - SDL_BLENDMODE_MOD = 0x00000004 /**< dst = src * dst */ + 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 -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_clipboard.h b/include/SDL_clipboard.h index 9d86b6b49..1f5742d16 100644 --- a/include/SDL_clipboard.h +++ b/include/SDL_clipboard.h @@ -33,9 +33,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* Function prototypes */ @@ -64,9 +62,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_config.h b/include/SDL_config.h index f4ac5b3db..9022af81e 100644 --- a/include/SDL_config.h +++ b/include/SDL_config.h @@ -27,7 +27,7 @@ /** * \file SDL_config.h */ - + /* Add any platform that doesn't build using the configure system. */ #if defined(__WIN32__) #include "SDL_config_windows.h" @@ -35,7 +35,7 @@ #include "SDL_config_windowsrt.h" #elif defined(__MACOSX__) #include "SDL_config_macosx.h" -#elif defined(__IPHONEOS__) +#elif defined(__IPHONEOS__) #include "SDL_config_iphoneos.h" #elif defined(__ANDROID__) #include "SDL_config_android.h" diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index c3b9bc708..12c14fa24 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -37,7 +37,13 @@ #cmakedefine volatile @HAVE_VOLATILE@ /* C datatypes */ -#cmakedefine SIZEOF_VOIDP @SIZEOF_VOIDP@ +/* 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@ @@ -195,6 +201,8 @@ #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@ @@ -266,6 +274,7 @@ #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@ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index bd2be4b2f..04ee11052 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -42,7 +42,11 @@ #undef volatile /* C datatypes */ -#undef SIZEOF_VOIDP +#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 @@ -158,8 +162,9 @@ #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 */ @@ -198,6 +203,8 @@ #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC #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_PAUDIO @@ -268,6 +275,7 @@ #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 diff --git a/include/SDL_config_android.h b/include/SDL_config_android.h index 1676eb429..e0c019f24 100644 --- a/include/SDL_config_android.h +++ b/include/SDL_config_android.h @@ -26,109 +26,111 @@ /** * \file SDL_config_android.h - * + * * This is a configuration that can be used to build SDL for Android */ #include -#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 +#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_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_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 +#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 +#define SDL_JOYSTICK_ANDROID 1 +#define SDL_HAPTIC_DUMMY 1 /* Enable various shared object loading systems */ -#define SDL_LOADSO_DLOPEN 1 +#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_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 +#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 diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h index f7925d468..b27b18973 100644 --- a/include/SDL_config_iphoneos.h +++ b/include/SDL_config_iphoneos.h @@ -30,109 +30,109 @@ #define SIZEOF_VOIDP 4 #endif -#define HAVE_GCC_ATOMICS 1 +#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 +#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_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_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 +#define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DISABLED 1 +#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 +#define SDL_LOADSO_DISABLED 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 /* Supported video drivers */ -#define SDL_VIDEO_DRIVER_UIKIT 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 +#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 +#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 diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h index fece7fb5c..68a0ebb9b 100644 --- a/include/SDL_config_macosx.h +++ b/include/SDL_config_macosx.h @@ -30,106 +30,103 @@ /* This is a set of defines to configure the SDL features */ #ifdef __LP64__ - #define SIZEOF_VOIDP 8 + #define SIZEOF_VOIDP 8 #else - #define SIZEOF_VOIDP 4 + #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_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_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_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_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 +#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_HAPTIC_IOKIT 1 +#define SDL_JOYSTICK_IOKIT 1 +#define SDL_HAPTIC_IOKIT 1 /* Enable various shared object loading systems */ -#define SDL_LOADSO_DLOPEN 1 +#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_COCOA 1 -#define SDL_VIDEO_DRIVER_DUMMY 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" @@ -157,27 +154,27 @@ #endif #ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 +#define SDL_VIDEO_RENDER_OGL 1 #endif /* Enable OpenGL support */ #ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL 1 #endif #ifndef SDL_VIDEO_OPENGL_CGL -#define SDL_VIDEO_OPENGL_CGL 1 +#define SDL_VIDEO_OPENGL_CGL 1 #endif #ifndef SDL_VIDEO_OPENGL_GLX -#define SDL_VIDEO_OPENGL_GLX 1 +#define SDL_VIDEO_OPENGL_GLX 1 #endif /* 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 a8a699fa0..fe3cebc7e 100644 --- a/include/SDL_config_minimal.h +++ b/include/SDL_config_minimal.h @@ -26,14 +26,16 @@ /** * \file SDL_config_minimal.h - * + * * This is the minimal configuration that can be used to build SDL. */ -#include -#include +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 -#if !defined(_STDINT_H_) && !defined(_STDINT_H) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +/* 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; @@ -44,31 +46,33 @@ 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 +#define HAVE_STDINT_H 1 +#endif /* Visual Studio 2008 */ #ifdef __GNUC__ #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 #endif /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 +#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 +#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_pandora.h b/include/SDL_config_pandora.h index ebd9b6754..b93a1bc1a 100644 --- a/include/SDL_config_pandora.h +++ b/include/SDL_config_pandora.h @@ -57,7 +57,7 @@ #define HAVE_FREE 1 #define HAVE_ALLOCA 1 #define HAVE_GETENV 1 -#define HAVE_SETENV 1 +#define HAVE_SETENV 1 #define HAVE_PUTENV 1 #define HAVE_UNSETENV 1 #define HAVE_QSORT 1 diff --git a/include/SDL_config_psp.h b/include/SDL_config_psp.h index 036b30b28..bf456f688 100644 --- a/include/SDL_config_psp.h +++ b/include/SDL_config_psp.h @@ -30,93 +30,93 @@ #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 #endif -#define HAVE_GCC_ATOMICS 1 +#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 +#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_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 +#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 +#define SDL_THREAD_PSP 1 /* Enable the stub timer support (src/timer/psp/\*.c) */ -#define SDL_TIMERS_PSP 1 +#define SDL_TIMERS_PSP 1 /* Enable the stub joystick driver (src/joystick/psp/\*.c) */ -#define SDL_JOYSTICK_PSP 1 +#define SDL_JOYSTICK_PSP 1 /* Enable the stub audio driver (src/audio/psp/\*.c) */ -#define SDL_AUDIO_DRIVER_PSP 1 +#define SDL_AUDIO_DRIVER_PSP 1 /* PSP video dirver */ #define SDL_VIDEO_DRIVER_PSP 1 @@ -127,10 +127,10 @@ #define SDL_POWER_PSP 1 /* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DISABLED 1 +#define SDL_HAPTIC_DISABLED 1 /* PSP can't load shared object (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 +#define SDL_LOADSO_DISABLED 1 -#endif /* _SDL_config_minimal_h */ +#endif /* _SDL_config_psp_h */ diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h index c3f229f0c..0b7621564 100644 --- a/include/SDL_config_windows.h +++ b/include/SDL_config_windows.h @@ -28,7 +28,7 @@ #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 +#define HAVE_STDINT_H 1 #elif defined(_MSC_VER) typedef signed __int8 int8_t; typedef unsigned __int8 uint8_t; @@ -76,8 +76,7 @@ typedef unsigned int uintptr_t; # define SIZEOF_VOIDP 4 #endif -/* Enabled for SDL 1.2 (binary compatibility) */ -//#define HAVE_LIBC 1 +/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ #ifdef HAVE_LIBC /* Useful headers */ #define HAVE_STDIO_H 1 @@ -136,49 +135,47 @@ typedef unsigned int uintptr_t; #define HAVE_SINF 1 #define HAVE_SQRT 1 #else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 #endif /* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_DSOUND 1 -#ifndef __GNUC__ -#define SDL_AUDIO_DRIVER_XAUDIO2 1 -#endif -#define SDL_AUDIO_DRIVER_WINMM 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 +#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 +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_HAPTIC_DINPUT 1 /* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 +#define SDL_LOADSO_WINDOWS 1 /* Enable various threading systems */ -#define SDL_THREAD_WINDOWS 1 +#define SDL_THREAD_WINDOWS 1 /* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 +#define SDL_TIMER_WINDOWS 1 /* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDOWS 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDOWS 1 #ifndef SDL_VIDEO_RENDER_D3D -#define SDL_VIDEO_RENDER_D3D 1 +#define SDL_VIDEO_RENDER_D3D 1 #endif /* Enable OpenGL support */ #ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL 1 #endif #ifndef SDL_VIDEO_OPENGL_WGL -#define SDL_VIDEO_OPENGL_WGL 1 +#define SDL_VIDEO_OPENGL_WGL 1 #endif #ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 +#define SDL_VIDEO_RENDER_OGL 1 #endif /* Enable system power support */ @@ -186,7 +183,7 @@ typedef unsigned int uintptr_t; /* Enable assembly routines (Win64 doesn't have inline asm) */ #ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 +#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 index 2c7295816..9be04d92a 100644 --- a/include/SDL_config_wiz.h +++ b/include/SDL_config_wiz.h @@ -51,7 +51,7 @@ #define HAVE_FREE 1 #define HAVE_ALLOCA 1 #define HAVE_GETENV 1 -#define HAVE_SETENV 1 +#define HAVE_SETENV 1 #define HAVE_PUTENV 1 #define HAVE_UNSETENV 1 #define HAVE_QSORT 1 diff --git a/include/SDL_cpuinfo.h b/include/SDL_cpuinfo.h index 59ba77de2..a722ee4d5 100644 --- a/include/SDL_cpuinfo.h +++ b/include/SDL_cpuinfo.h @@ -21,7 +21,7 @@ /** * \file SDL_cpuinfo.h - * + * * CPU feature detection for SDL. */ @@ -66,9 +66,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* This is a guess for the cacheline size used for padding. @@ -139,9 +137,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_endian.h b/include/SDL_endian.h index a1a11df09..c58edcca0 100644 --- a/include/SDL_endian.h +++ b/include/SDL_endian.h @@ -21,7 +21,7 @@ /** * \file SDL_endian.h - * + * * Functions for reading and writing endian-specific values */ @@ -34,8 +34,8 @@ * \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? */ @@ -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 */ @@ -59,9 +59,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -210,31 +208,29 @@ SDL_SwapFloat(float x) */ /*@{*/ #if SDL_BYTEORDER == SDL_LIL_ENDIAN -#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) +#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_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) +#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 -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_error.h b/include/SDL_error.h index 81c64da66..229b26802 100644 --- a/include/SDL_error.h +++ b/include/SDL_error.h @@ -21,7 +21,7 @@ /** * \file SDL_error.h - * + * * Simple error message routines for SDL. */ @@ -33,9 +33,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* Public functions */ @@ -46,14 +44,14 @@ extern DECLSPEC void SDLCALL SDL_ClearError(void); /** * \name Internal error functions - * - * \internal + * + * \internal * Private error reporting function - used internally. */ /*@{*/ -#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)) +#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, @@ -69,9 +67,7 @@ extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_events.h b/include/SDL_events.h index fe742b237..b997b5ec8 100644 --- a/include/SDL_events.h +++ b/include/SDL_events.h @@ -21,7 +21,7 @@ /** * \file SDL_events.h - * + * * Include file for SDL event handling. */ @@ -42,14 +42,12 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* General keyboard/mouse state definitions */ -#define SDL_RELEASED 0 -#define SDL_PRESSED 1 +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 /** * \brief The types of events that can be delivered. @@ -61,6 +59,32 @@ typedef enum /* 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 */ @@ -86,13 +110,13 @@ typedef enum 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 */ + /* 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, @@ -129,7 +153,7 @@ typedef struct SDL_CommonEvent Uint32 type; Uint32 timestamp; } SDL_CommonEvent; - + /** * \brief Window state change event data (event.window.*) */ @@ -197,10 +221,7 @@ typedef struct SDL_MouseMotionEvent Uint32 timestamp; Uint32 windowID; /**< The window with mouse focus, if any */ Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Uint8 state; /**< The current button state */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; + 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 */ @@ -259,7 +280,7 @@ typedef struct SDL_JoyAxisEvent typedef struct SDL_JoyBallEvent { Uint32 type; /**< ::SDL_JOYBALLMOTION */ - Uint32 timestamp; + Uint32 timestamp; SDL_JoystickID which; /**< The joystick instance id */ Uint8 ball; /**< The joystick trackball index */ Uint8 padding1; @@ -275,14 +296,14 @@ typedef struct SDL_JoyBallEvent typedef struct SDL_JoyHatEvent { Uint32 type; /**< ::SDL_JOYHATMOTION */ - Uint32 timestamp; + 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; @@ -295,7 +316,7 @@ typedef struct SDL_JoyHatEvent typedef struct SDL_JoyButtonEvent { Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ - Uint32 timestamp; + Uint32 timestamp; SDL_JoystickID which; /**< The joystick instance id */ Uint8 button; /**< The joystick button index */ Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ @@ -308,9 +329,9 @@ typedef struct SDL_JoyButtonEvent */ 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 */ + 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; @@ -320,7 +341,7 @@ typedef struct SDL_JoyDeviceEvent typedef struct SDL_ControllerAxisEvent { Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ - Uint32 timestamp; + Uint32 timestamp; SDL_JoystickID which; /**< The joystick instance id */ Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ Uint8 padding1; @@ -337,7 +358,7 @@ typedef struct SDL_ControllerAxisEvent typedef struct SDL_ControllerButtonEvent { Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ - Uint32 timestamp; + Uint32 timestamp; SDL_JoystickID which; /**< The joystick instance id */ Uint8 button; /**< The controller button (SDL_GameControllerButton) */ Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ @@ -351,9 +372,9 @@ typedef struct SDL_ControllerButtonEvent */ 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 */ + 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; @@ -385,13 +406,15 @@ typedef struct SDL_MultiGestureEvent float dTheta; float dDist; float x; - float y; + float y; Uint16 numFingers; Uint16 padding; } SDL_MultiGestureEvent; -/* (event.dgesture.*) */ +/** + * \brief Dollar Gesture Event (event.dgesture.*) + */ typedef struct SDL_DollarGestureEvent { Uint32 type; /**< ::SDL_DOLLARGESTURE */ @@ -427,13 +450,21 @@ typedef struct SDL_QuitEvent Uint32 timestamp; } SDL_QuitEvent; +/** + * \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_NUMEVENTS-1 */ + Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ Uint32 timestamp; Uint32 windowID; /**< The associated window if any */ Sint32 code; /**< User defined event code */ @@ -477,9 +508,9 @@ typedef union SDL_Event 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_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 */ @@ -503,9 +534,9 @@ typedef union SDL_Event /** * 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); @@ -520,20 +551,20 @@ typedef enum /** * Checks the event queue for messages and optionally returns them. - * + * * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to * the back of the event queue. - * + * * 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 + * + * 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, @@ -555,40 +586,41 @@ extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); /** * \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 + * + * \param event If not NULL, the next event is removed from the queue and * stored in that area. */ extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); /** * \brief Waits indefinitely 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 + * + * \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 + * \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 + * + * \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 + * + * \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); @@ -598,21 +630,21 @@ 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 protypted as: + * + * The filter is prototyped as: * \code * int SDL_EventFilter(void *userdata, SDL_Event * event); * \endcode * * 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 + * 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. - * - * \warning Be very careful of what you do in the event filter function, as + * + * \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 + * + * 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. @@ -650,18 +682,18 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, void *userdata); /*@{*/ -#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 + * - 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 + * - 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 + * - 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); @@ -679,9 +711,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_gamecontroller.h b/include/SDL_gamecontroller.h index b90c4009f..e55749ce3 100644 --- a/include/SDL_gamecontroller.h +++ b/include/SDL_gamecontroller.h @@ -35,9 +35,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -46,6 +44,10 @@ extern "C" { * 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 */ @@ -55,10 +57,10 @@ 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_CONTROLLER_BINDTYPE_NONE = 0, + SDL_CONTROLLER_BINDTYPE_BUTTON, + SDL_CONTROLLER_BINDTYPE_AXIS, + SDL_CONTROLLER_BINDTYPE_HAT } SDL_GameControllerBindType; /** @@ -66,43 +68,43 @@ typedef enum */ typedef struct SDL_GameControllerButtonBind { - SDL_GameControllerBindType bindType; - union - { - int button; - int axis; - struct { + SDL_GameControllerBindType bindType; + union + { + int button; + int axis; + struct { int hat; int hat_mask; } hat; - } value; + } 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++; - * } + * 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 + * 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 + * 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,Aferglow 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", + * "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", * */ @@ -179,7 +181,7 @@ 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. */ @@ -187,18 +189,18 @@ extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); /** - * The list of axii available from a controller + * 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_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; /** @@ -234,23 +236,23 @@ SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, */ 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_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; /** @@ -287,9 +289,7 @@ extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecon /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_gesture.h b/include/SDL_gesture.h index 458c36775..21f10ead7 100644 --- a/include/SDL_gesture.h +++ b/include/SDL_gesture.h @@ -21,7 +21,7 @@ /** * \file SDL_gesture.h - * + * * Include file for SDL gesture event handling. */ @@ -38,9 +38,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif typedef Sint64 SDL_GestureID; @@ -80,9 +78,7 @@ extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWo /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_haptic.h b/include/SDL_haptic.h index c506c295e..da555c9c3 100644 --- a/include/SDL_haptic.h +++ b/include/SDL_haptic.h @@ -21,10 +21,10 @@ /** * \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. @@ -119,16 +119,14 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { - /* *INDENT-ON* */ #endif /* __cplusplus */ /** * \typedef SDL_Haptic - * + * * \brief The haptic structure used to identify an SDL haptic. - * + * * \sa SDL_HapticOpen * \sa SDL_HapticOpenFromJoystick * \sa SDL_HapticClose @@ -139,7 +137,7 @@ typedef struct _SDL_Haptic SDL_Haptic; /** * \name Haptic features - * + * * Different haptic features a device can have. */ /*@{*/ @@ -153,68 +151,73 @@ typedef struct _SDL_Haptic SDL_Haptic; * \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 Square wave effect supported. - * - * Periodic haptic effect that simulates square waves. - * - * \sa SDL_HapticPeriodic + * \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_SQUARE (1<<2) +#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. * @@ -224,17 +227,17 @@ typedef struct _SDL_Haptic SDL_Haptic; /** * \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. * @@ -244,17 +247,17 @@ typedef struct _SDL_Haptic SDL_Haptic; /** * \brief Friction effect supported - uses axes movement. - * - * Condition haptic effect that simulates friction. Effect is based on the + * + * 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) @@ -265,34 +268,34 @@ typedef struct _SDL_Haptic SDL_Haptic; /** * \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 */ @@ -306,21 +309,21 @@ typedef struct _SDL_Haptic SDL_Haptic; /** * \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 @@ -343,7 +346,7 @@ typedef struct _SDL_Haptic SDL_Haptic; /** * \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. @@ -361,8 +364,8 @@ typedef struct _SDL_Haptic SDL_Haptic; | | |'-----'| |__|~')_____(' [ COMPUTER ] - - + + North (0,-1) ^ | @@ -372,22 +375,22 @@ typedef struct _SDL_Haptic SDL_Haptic; | v South (0,1) - - + + [ USER ] \|||/ (o o) ---ooO-(_)-Ooo--- \endverbatim - * - * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a + * + * 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: @@ -395,13 +398,13 @@ typedef struct _SDL_Haptic SDL_Haptic; * - 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 + * 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). @@ -411,17 +414,17 @@ typedef struct _SDL_Haptic SDL_Haptic; * 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. @@ -442,12 +445,12 @@ typedef struct 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 */ @@ -477,25 +480,25 @@ typedef struct SDL_HapticConstant /** * \brief A structure containing a template for a Periodic effect. - * + * * The struct handles the following effects: * - ::SDL_HAPTIC_SINE - * - ::SDL_HAPTIC_SQUARE + * - ::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 cyle meaning that giving the phase a value - * of 9000 will displace it 25% of it's period. Here are sample values: + * + * 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 it's period. - * - 18000: Displaced 50% of it's period. - * - 27000: Displaced 75% of it's period. - * - 36000: Displaced 100% of it's period, same as 0, but 0 is preffered. + * - 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 @@ -503,30 +506,30 @@ typedef struct SDL_HapticConstant __ __ __ __ / \ / \ / \ / / \__/ \__/ \__/ - + SDL_HAPTIC_SQUARE __ __ __ __ __ | | | | | | | | | | | |__| |__| |__| |__| | - + SDL_HAPTIC_TRIANGLE /\ /\ /\ /\ /\ / \ / \ / \ / \ / / \/ \/ \/ \/ - + SDL_HAPTIC_SAWTOOTHUP /| /| /| /| /| /| /| / | / | / | / | / | / | / | / |/ |/ |/ |/ |/ |/ | - + SDL_HAPTIC_SAWTOOTHDOWN \ |\ |\ |\ |\ |\ |\ | \ | \ | \ | \ | \ | \ | \ | \| \| \| \| \| \| \| \endverbatim - * + * * \sa SDL_HAPTIC_SINE - * \sa SDL_HAPTIC_SQUARE + * \sa SDL_HAPTIC_LEFTRIGHT * \sa SDL_HAPTIC_TRIANGLE * \sa SDL_HAPTIC_SAWTOOTHUP * \sa SDL_HAPTIC_SAWTOOTHDOWN @@ -535,7 +538,7 @@ typedef struct SDL_HapticConstant typedef struct SDL_HapticPeriodic { /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_SQUARE, + 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. */ @@ -563,21 +566,21 @@ typedef struct 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 + * 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 @@ -611,14 +614,14 @@ typedef struct 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 - * they effects get added to the ramp effect making the effect become + * the effects get added to the ramp effect making the effect become * quadratic instead of linear. - * + * * \sa SDL_HAPTIC_RAMP * \sa SDL_HapticEffect */ @@ -647,16 +650,41 @@ typedef struct SDL_HapticRamp 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 it's exact shape. You will have to allocate 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 */ @@ -689,34 +717,34 @@ typedef struct 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 + * + * 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 - * they joystick. - * + * 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. @@ -734,18 +762,18 @@ typedef struct SDL_HapticCustom | / \ | / \ | / \ - | / \ + | / \ | 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. * @@ -753,6 +781,7 @@ typedef struct SDL_HapticCustom * \sa SDL_HapticPeriodic * \sa SDL_HapticCondition * \sa SDL_HapticRamp + * \sa SDL_HapticLeftRight * \sa SDL_HapticCustom */ typedef union SDL_HapticEffect @@ -763,25 +792,26 @@ typedef union SDL_HapticEffect 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 joysticks attached to the system. - * + * \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 it's name. + * + * \param device_index Index of the device to get its name. * \return Name of the device or NULL on error. * * \sa SDL_NumHaptics @@ -790,11 +820,11 @@ 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 + * + * The index passed as an argument refers to the N'th Haptic device on this * system. * - * When opening a haptic device, it's gain will be set to maximum and + * 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(). * @@ -814,10 +844,10 @@ 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 */ @@ -825,10 +855,10 @@ 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 */ @@ -836,18 +866,18 @@ 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 */ @@ -855,29 +885,29 @@ 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 + * + * 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 */ @@ -886,34 +916,34 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_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 - * aproximation. Always check to see if your created effect was actually + * 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 + * \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 completness. - * + * + * 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. @@ -925,17 +955,17 @@ extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); /** * \brief Gets the haptic devices supported features in bitwise matter. - * - * Example: + * + * Example: * \code - * if (SDL_HapticQueryEffects(haptic) & SDL_HAPTIC_CONSTANT) { + * 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 */ @@ -944,18 +974,18 @@ 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 */ @@ -965,11 +995,11 @@ extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, /** * \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 @@ -979,17 +1009,17 @@ extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, /** * \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 The id of the effect on success or -1 on error. - * + * \return 0 on success or -1 on error. + * * \sa SDL_HapticNewEffect * \sa SDL_HapticRunEffect * \sa SDL_HapticDestroyEffect @@ -999,19 +1029,19 @@ extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, SDL_HapticEffect * data); /** - * \brief Runs the haptic effect on it's assosciated haptic device. - * + * \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 @@ -1021,12 +1051,12 @@ extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, Uint32 iterations); /** - * \brief Stops the haptic effect on it's assosciated haptic device. - * + * \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 */ @@ -1035,13 +1065,13 @@ extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, /** * \brief Destroys a haptic effect on the device. - * - * This will stop the effect if it's running. Effects are automatically + * + * 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, @@ -1049,14 +1079,13 @@ extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, /** * \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 it's status. - * \return 0 if it isn't playing, ::SDL_HAPTIC_PLAYING if it is playing - * or -1 on error. - * + * \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 */ @@ -1065,26 +1094,26 @@ extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, /** * \brief Sets the global gain of the device. - * + * * Device must support the ::SDL_HAPTIC_GAIN feature. - * - * The user may specify the maxmimum 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 + * + * 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 + * + * Autocenter should be between 0 and 100. Setting it to 0 will disable * autocentering. * * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. @@ -1092,7 +1121,7 @@ extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); * \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, @@ -1100,42 +1129,42 @@ extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, /** * \brief Pauses a haptic device. - * - * Device must support the ::SDL_HAPTIC_PAUSE feature. Call + * + * 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.. + * \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. @@ -1164,7 +1193,7 @@ extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); * * \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 miliseconds. + * \param length Length of the rumble to play in milliseconds. * \return 0 on success or -1 on error. * * \sa SDL_HapticRumbleSupported @@ -1185,13 +1214,9 @@ extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float stre */ extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); - - /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_hints.h b/include/SDL_hints.h index 315a33133..74b63ee09 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -21,7 +21,7 @@ /** * \file SDL_hints.h - * + * * Official documentation for SDL configuration variables * * This file contains functions to set and get configuration hints, @@ -44,15 +44,13 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** - * \brief A variable controlling how 3D acceleration is used to accelerate the SDL 1.2 screen surface. + * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. * - * SDL can try to accelerate the SDL 1.2 screen surface by using streaming + * 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. * @@ -102,14 +100,14 @@ extern "C" { * 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" - Anisotropic filtering (supported by 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 1.2 screen surface should be synchronized with the vertical refresh, to avoid tearing. + * \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 @@ -169,7 +167,7 @@ extern "C" { */ #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. * @@ -183,7 +181,7 @@ extern "C" { * "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. * @@ -208,7 +206,7 @@ extern "C" { /** * \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) @@ -217,9 +215,23 @@ extern "C" { #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 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 @@ -228,6 +240,23 @@ extern "C" { #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 @@ -246,7 +275,7 @@ typedef enum * 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, @@ -255,20 +284,42 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, /** * \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 * @@ -279,9 +330,7 @@ extern DECLSPEC void SDLCALL SDL_ClearHints(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_joystick.h b/include/SDL_joystick.h index c948c05b3..266740348 100644 --- a/include/SDL_joystick.h +++ b/include/SDL_joystick.h @@ -21,7 +21,7 @@ /** * \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 @@ -30,7 +30,7 @@ * 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 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. * * @@ -45,9 +45,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -56,6 +54,10 @@ extern "C" { * 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 */ @@ -64,7 +66,7 @@ typedef struct _SDL_Joystick SDL_Joystick; /* A structure that encodes the stable unique id for a joystick device */ typedef struct { - Uint8 data[16]; + Uint8 data[16]; } SDL_JoystickGUID; typedef Sint32 SDL_JoystickID; @@ -84,11 +86,11 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); /** - * Open a joystick for use. - * The index passed as an argument refers tothe N'th joystick on the system. + * 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. - * + * * \return A joystick identifier, or NULL if an error occurred. */ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); @@ -98,7 +100,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); * 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 */ @@ -137,7 +139,7 @@ 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. */ @@ -155,7 +157,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); /** * Update the current state of the open joysticks. - * + * * This is called automatically by the event loop if any joystick * events are enabled. */ @@ -163,20 +165,20 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); /** * 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. - * + * * 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. - * + * * 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, @@ -186,22 +188,22 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, * \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. * * The hat indices start at index 0. - * + * * \return The return value is one of the following positions: * - ::SDL_HAT_CENTERED * - ::SDL_HAT_UP @@ -218,9 +220,9 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, /** * Get the ball axis change since the last poll. - * + * * \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, @@ -228,7 +230,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, /** * Get the current state of a button on a joystick. - * + * * The button indices start at index 0. */ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, @@ -242,9 +244,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_keyboard.h b/include/SDL_keyboard.h index e6aa484ec..e10f9fd15 100644 --- a/include/SDL_keyboard.h +++ b/include/SDL_keyboard.h @@ -21,7 +21,7 @@ /** * \file SDL_keyboard.h - * + * * Include file for SDL keyboard event handling */ @@ -36,20 +36,20 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * \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 unicode; /**< \deprecated use SDL_TextInputEvent instead */ + Uint32 unused; } SDL_Keysym; /* Function prototypes */ @@ -61,20 +61,20 @@ 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 - * Uint8 *state = SDL_GetKeyboardState(NULL); + * const Uint8 *state = SDL_GetKeyboardState(NULL); * if ( state[SDL_SCANCODE_RETURN] ) { * printf(" is pressed.\n"); * } * \endcode */ -extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); +extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); /** * \brief Get the current key modifier state for the keyboard. @@ -83,7 +83,7 @@ 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); @@ -91,9 +91,9 @@ 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); @@ -101,16 +101,16 @@ 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); /** * \brief Get a human-readable name for a scancode. - * + * * \return A pointer to the name for the scancode. * If the scancode doesn't have a name, this function returns * an empty string (""). @@ -121,7 +121,7 @@ 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 @@ -130,19 +130,19 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); /** * \brief Get a human-readable name for a key. - * + * * \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 + * 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 (""). - * + * * \sa SDL_Key */ extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); /** * \brief Get a key code from a human-readable name - * + * * \return key code, or SDLK_UNKNOWN if the name wasn't recognized * * \sa SDL_Keycode @@ -152,7 +152,7 @@ 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. - * + * * \sa SDL_StopTextInput() * \sa SDL_SetTextInputRect() * \sa SDL_HasScreenKeyboardSupport() @@ -170,7 +170,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); /** * \brief Stop receiving any text input events. * This function will hide the on-screen keyboard if supported. - * + * * \sa SDL_StartTextInput() * \sa SDL_HasScreenKeyboardSupport() */ @@ -179,38 +179,36 @@ extern DECLSPEC void SDLCALL SDL_StopTextInput(void); /** * \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_SetTextInputRect(SDL_Rect *rect); /** * \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 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 -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_keycode.h b/include/SDL_keycode.h index 70742b1e5..de584e126 100644 --- a/include/SDL_keycode.h +++ b/include/SDL_keycode.h @@ -21,7 +21,7 @@ /** * \file SDL_keycode.h - * + * * Defines constants which identify keyboard keys and modifiers. */ @@ -33,7 +33,7 @@ /** * \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 @@ -42,7 +42,7 @@ typedef Sint32 SDL_Keycode; #define SDLK_SCANCODE_MASK (1<<30) -#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) +#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) enum { @@ -85,7 +85,7 @@ enum SDLK_GREATER = '>', SDLK_QUESTION = '?', SDLK_AT = '@', - /* + /* Skip uppercase letters */ SDLK_LEFTBRACKET = '[', @@ -331,10 +331,10 @@ typedef enum 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) +#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 */ diff --git a/include/SDL_loadso.h b/include/SDL_loadso.h index edd32d5a0..790d0a724 100644 --- a/include/SDL_loadso.h +++ b/include/SDL_loadso.h @@ -24,7 +24,7 @@ * * System dependent library loading routines * - * Some things to keep in mind: + * 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. @@ -47,9 +47,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -74,9 +72,7 @@ extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_log.h b/include/SDL_log.h index ba56e40e7..79ae4cde4 100644 --- a/include/SDL_log.h +++ b/include/SDL_log.h @@ -21,7 +21,7 @@ /** * \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: @@ -42,9 +42,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif @@ -60,7 +58,7 @@ extern "C" { * * 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 + * at the VERBOSE level and all other categories are enabled at the * CRITICAL level. */ enum @@ -204,9 +202,7 @@ extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction call /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_main.h b/include/SDL_main.h index 09a5dcd8e..bbb7e859b 100644 --- a/include/SDL_main.h +++ b/include/SDL_main.h @@ -26,18 +26,40 @@ /** * \file SDL_main.h - * + * * Redefine main() on some platforms so that it is called by SDL. */ -#if defined(__WIN32__) || defined(__WINRT__) || defined(__IPHONEOS__) || defined(__ANDROID__) #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 + +#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 +#endif /* SDL_MAIN_HANDLED */ #ifdef __cplusplus -#define C_LINKAGE "C" +#define C_LINKAGE "C" #else #define C_LINKAGE #endif /* __cplusplus */ @@ -57,8 +79,8 @@ * \endcode */ -#ifdef SDL_MAIN_NEEDED -#define main SDL_main +#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) +#define main SDL_main #endif /** @@ -69,11 +91,18 @@ extern C_LINKAGE int SDL_main(int argc, char *argv[]); #include "begin_code.h" #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #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); + #ifdef __WIN32__ /** @@ -87,9 +116,7 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_messagebox.h b/include/SDL_messagebox.h index dd788cfad..cb1a1ccff 100644 --- a/include/SDL_messagebox.h +++ b/include/SDL_messagebox.h @@ -28,9 +28,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -58,7 +56,7 @@ typedef enum typedef struct { Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ - int buttonid; /**< User defined button id (value returned via SDL_MessageBox) */ + int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ const char * text; /**< The UTF-8 button text */ } SDL_MessageBoxButtonData; @@ -107,7 +105,8 @@ typedef struct /** * \brief Create a modal message box. * - * \param messagebox The SDL_MessageBox structure with title, text, etc. + * \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. @@ -136,9 +135,7 @@ extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *t /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_mouse.h b/include/SDL_mouse.h index 1cfe09260..36c29e90a 100644 --- a/include/SDL_mouse.h +++ b/include/SDL_mouse.h @@ -21,7 +21,7 @@ /** * \file SDL_mouse.h - * + * * Include file for SDL mouse event handling. */ @@ -35,9 +35,7 @@ #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 SDL_Cursor SDL_Cursor; /* Implementation dependent */ @@ -71,7 +69,7 @@ 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 @@ -90,11 +88,11 @@ 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, @@ -102,25 +100,25 @@ extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, /** * \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 int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); /** * \brief Query whether relative mouse mode is enabled. - * + * * \sa SDL_SetRelativeMouseMode() */ extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); @@ -128,19 +126,19 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); /** * \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 + *
1 0 Inverted color if possible, black * if not.
- * + * * \sa SDL_FreeCursor() */ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, @@ -150,7 +148,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, /** * \brief Create a color cursor. - * + * * \sa SDL_FreeCursor() */ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, @@ -174,19 +172,24 @@ extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); */ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); +/** + * \brief Return the default cursor. + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); + /** * \brief Frees a cursor created with SDL_CreateCursor(). - * + * * \sa SDL_CreateCursor() */ extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); /** * \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 + * + * \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); @@ -197,24 +200,22 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); * - 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) +#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 -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_mutex.h b/include/SDL_mutex.h index 30519b87f..3efc4a890 100644 --- a/include/SDL_mutex.h +++ b/include/SDL_mutex.h @@ -24,7 +24,7 @@ /** * \file SDL_mutex.h - * + * * Functions to provide thread synchronization primitives. */ @@ -34,21 +34,19 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * 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) +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) /** @@ -67,31 +65,31 @@ extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); /** * Lock the mutex. - * + * * \return 0, or -1 on error. */ -#define SDL_mutexP(m) SDL_LockMutex(m) +#define SDL_mutexP(m) SDL_LockMutex(m) extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); /** * Try to lock the mutex - * + * * \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error */ extern DECLSPEC int SDLCALL SDL_TryLockMutex(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) +#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); @@ -119,34 +117,34 @@ extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); /** - * This function suspends the calling thread until the semaphore pointed - * to by \c sem has a positive count. It then atomically decreases the + * 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); /** * Non-blocking variant of SDL_SemWait(). - * - * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would + * + * \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); /** * Variant of SDL_SemWait() with a timeout in milliseconds. - * - * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not * succeed in the allotted time, and -1 on error. - * - * \warning On some platforms this function is implemented by looping with a + * + * \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); /** * Atomically increases the semaphore's count (not blocking). - * + * * \return 0, or -1 on error. */ extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); @@ -205,7 +203,7 @@ 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. */ extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); @@ -219,11 +217,11 @@ extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); /** * 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. */ extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); @@ -233,7 +231,7 @@ extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not * signaled in the allotted time, and -1 on error. * - * \warning On some platforms this function is implemented by looping with a + * \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, @@ -244,9 +242,7 @@ extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_name.h b/include/SDL_name.h index 511619af5..d0469e1f2 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 079ed74e1..2f120aa95 100644 --- a/include/SDL_opengl.h +++ b/include/SDL_opengl.h @@ -21,7 +21,7 @@ /** * \file SDL_opengl.h - * + * * This is a simple file to encapsulate the OpenGL API headers. */ @@ -40,10 +40,6 @@ #include #endif -#ifdef __HAIKU__ /* !!! FIXME: temp compiler warning fix... */ -#define NO_SDL_GLEXT 1 -#endif - #ifdef __glext_h_ /* Someone has already included glext.h */ #define NO_SDL_GLEXT @@ -63,23 +59,22 @@ /** * \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/ + * http://www.opengl.org/registry/ */ /** * \def NO_SDL_GLEXT - * - * Define this if you have your own version of glext.h and want to disable the + * + * 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) -/* *INDENT-OFF* */ #ifndef __glext_h_ #define __glext_h_ @@ -89,7 +84,7 @@ extern "C" { /* ** 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 @@ -97,10 +92,10 @@ extern "C" { ** 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. @@ -11122,7 +11117,6 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons #endif #endif -/* *INDENT-ON* */ #endif /* NO_SDL_GLEXT */ #endif /* !__IPHONEOS__ */ diff --git a/include/SDL_opengles.h b/include/SDL_opengles.h index f33e190d9..00e60f5c1 100644 --- a/include/SDL_opengles.h +++ b/include/SDL_opengles.h @@ -21,7 +21,7 @@ /** * \file SDL_opengles.h - * + * * This is a simple file to encapsulate the OpenGL ES 1.X API headers. */ diff --git a/include/SDL_opengles2.h b/include/SDL_opengles2.h index 3d172c3f1..7697626f4 100644 --- a/include/SDL_opengles2.h +++ b/include/SDL_opengles2.h @@ -21,7 +21,7 @@ /** * \file SDL_opengles.h - * + * * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. */ diff --git a/include/SDL_pixels.h b/include/SDL_pixels.h index e73215260..5e17cba53 100644 --- a/include/SDL_pixels.h +++ b/include/SDL_pixels.h @@ -21,7 +21,7 @@ /** * \file SDL_pixels.h - * + * * Header for the enumerated pixel format definitions. */ @@ -31,14 +31,12 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * \name Transparency definitions - * + * * These define alpha as the opacity of a surface. */ /*@{*/ @@ -117,11 +115,11 @@ enum ((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_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) || \ @@ -301,9 +299,9 @@ 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, @@ -315,10 +313,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, /** * \brief Convert a bpp and RGBA masks to an enumerated pixel format. - * - * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion + * + * \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, @@ -338,13 +336,13 @@ extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); /** - * \brief Create a palette structure with the specified number of color + * \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); @@ -357,12 +355,12 @@ extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, /** * \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, @@ -371,14 +369,14 @@ extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, /** * \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, @@ -386,7 +384,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, /** * \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, @@ -395,7 +393,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, /** * \brief Get the RGB components from a pixel of the specified format. - * + * * \sa SDL_GetRGBA */ extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, @@ -404,7 +402,7 @@ extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, /** * \brief Get the RGBA components from a pixel of the specified format. - * + * * \sa SDL_GetRGB */ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, @@ -420,9 +418,7 @@ extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_platform.h b/include/SDL_platform.h index e1794cd82..1e8e0d9f4 100644 --- a/include/SDL_platform.h +++ b/include/SDL_platform.h @@ -21,7 +21,7 @@ /** * \file SDL_platform.h - * + * * Try to get a standard set of platform defines. */ @@ -30,39 +30,39 @@ #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 +#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__ @@ -82,72 +82,57 @@ #else /* if not compiling for iPhone */ #undef __MACOSX__ -#define __MACOSX__ 1 +#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) -/* Try to find out what version of Windows we are compiling for */ -#if defined(_MSC_VER) && (_MSC_VER >= 1700) /* _MSC_VER==1700 for MSVC 2012 */ -#include -#endif -/* Default to classic, Win32 / Desktop compilation if the version of Windows - cannot be determined via winapifamily.h. */ -#if ! defined(WINAPI_FAMILY_PARTITION) +#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) #undef __WIN32__ -#define __WIN32__ 1 -#else -/* Include Win32 / Desktop App APIs in SDL, if available: */ -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -#undef __WIN32__ -#define __WIN32__ 1 -#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) -/* Include WinRT / Windows Store APIs in SDL, if available: */ -#undef __WINRT__ -#define __WINRT__ 1 +#define __WIN32__ 1 #endif -#endif /* if ! defined(WINAPI_FAMILY_PARTITION) ; else */ -#endif /* if defined(WIN32) || defined(_WIN32) */ - #if defined(__PSP__) -#define __PSP__ 1 +#undef __PSP__ +#define __PSP__ 1 #endif #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -157,9 +142,7 @@ extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_power.h b/include/SDL_power.h index d796aee28..4f70c5bb1 100644 --- a/include/SDL_power.h +++ b/include/SDL_power.h @@ -24,7 +24,7 @@ /** * \file SDL_power.h - * + * * Header for the SDL power management routines. */ @@ -33,9 +33,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -53,24 +51,22 @@ typedef enum /** * \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 -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_quit.h b/include/SDL_quit.h index 5c7d343bd..485e42db0 100644 --- a/include/SDL_quit.h +++ b/include/SDL_quit.h @@ -21,7 +21,7 @@ /** * \file SDL_quit.h - * + * * Include file for SDL quit event handling. */ @@ -33,11 +33,11 @@ /** * \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) @@ -46,7 +46,7 @@ * 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() */ diff --git a/include/SDL_rect.h b/include/SDL_rect.h index a509c7004..c8af7c197 100644 --- a/include/SDL_rect.h +++ b/include/SDL_rect.h @@ -21,7 +21,7 @@ /** * \file SDL_rect.h - * + * * Header file for SDL_rect definition and management functions. */ @@ -36,9 +36,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -54,7 +52,7 @@ typedef struct /** * \brief A rectangle, with the origin at the upper left. - * + * * \sa SDL_RectEmpty * \sa SDL_RectEquals * \sa SDL_HasIntersection @@ -71,18 +69,23 @@ typedef struct SDL_Rect /** * \brief Returns true if the rectangle has no area. */ -#define SDL_RectEmpty(X) ((!(X)) || ((X)->w <= 0) || ((X)->h <= 0)) +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. */ -#define SDL_RectEquals(A, B) (((A)) && ((B)) && \ - ((A)->x == (B)->x) && ((A)->y == (B)->y) && \ - ((A)->w == (B)->w) && ((A)->h == (B)->h)) +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, @@ -90,7 +93,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, /** * \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, @@ -116,7 +119,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, /** * \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 * @@ -126,9 +129,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_render.h b/include/SDL_render.h index 591de81b0..1e24619f0 100644 --- a/include/SDL_render.h +++ b/include/SDL_render.h @@ -21,7 +21,7 @@ /** * \file SDL_render.h - * + * * Header file for SDL 2D rendering functions. * * This API supports the following features: @@ -37,9 +37,12 @@ * 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 rotation and particle effects and + * 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 @@ -52,9 +55,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -62,10 +63,10 @@ extern "C" { */ typedef enum { - SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ - SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware + 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 + SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized with the refresh rate */ SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports rendering to texture */ @@ -130,28 +131,28 @@ typedef struct SDL_Texture SDL_Texture; /* Function prototypes */ /** - * \brief Get the number of 2D rendering drivers available for the current + * \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 + * \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 + * \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, @@ -175,14 +176,14 @@ extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( /** * \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 + * \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() @@ -192,11 +193,11 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, /** * \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() */ @@ -213,18 +214,25 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); 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 + * + * \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() @@ -236,13 +244,14 @@ extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, /** * \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() */ @@ -250,15 +259,15 @@ extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer /** * \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 + * \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, @@ -267,15 +276,15 @@ extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, /** * \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 + * + * \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, @@ -284,14 +293,14 @@ extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, /** * \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, @@ -300,13 +309,13 @@ extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, /** * \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 + * + * \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, @@ -314,12 +323,12 @@ extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, /** * \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, @@ -327,16 +336,16 @@ extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, /** * \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, @@ -344,12 +353,12 @@ extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, /** * \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, @@ -357,15 +366,15 @@ extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, /** * \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 + * \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, @@ -374,17 +383,17 @@ extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, /** * \brief Lock a portion of the texture for write-only pixel access. - * - * \param texture The texture to lock for access, which was created with + * + * \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 + * \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, + * \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, @@ -393,7 +402,7 @@ extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, /** * \brief Unlock a texture, uploading the changes to video memory, if needed. - * + * * \sa SDL_LockTexture() */ extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); @@ -410,6 +419,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *rendere /** * \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 @@ -431,6 +441,7 @@ 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 * @@ -442,7 +453,7 @@ extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer * 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 + * \note If this function results in scaling or subpixel drawing by the * rendering backend, it will be handled using the appropriate * quality hints. * @@ -455,22 +466,25 @@ extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, in /** * \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 *y); +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. * - * \note When the window is resized, the current viewport is automatically - * centered within the new window size. + * \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() @@ -486,9 +500,36 @@ extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, 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 * @@ -496,7 +537,7 @@ extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, * 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 + * \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. * @@ -509,6 +550,7 @@ extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, /** * \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 * @@ -519,13 +561,14 @@ extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, /** * \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 + * \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, @@ -534,13 +577,14 @@ extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer, /** * \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, + * \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, @@ -549,14 +593,15 @@ extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer, /** * \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 + * + * \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, @@ -564,11 +609,12 @@ extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, /** * \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, @@ -578,15 +624,18 @@ extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, * \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, @@ -594,10 +643,11 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, /** * \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, @@ -606,12 +656,13 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, /** * \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, @@ -619,10 +670,11 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, /** * \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, @@ -631,9 +683,10 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, /** * \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, @@ -641,10 +694,11 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, /** * \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, @@ -653,10 +707,11 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, /** * \brief Fill a rectangle on the current rendering target with the drawing color. - * - * \param rect A pointer to the destination rectangle, or NULL for the entire + * + * \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, @@ -664,10 +719,11 @@ extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, /** * \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, @@ -676,13 +732,14 @@ extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, /** * \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 + * \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 + * \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, @@ -691,8 +748,9 @@ extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, 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 + * \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. @@ -701,7 +759,7 @@ extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, * \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, @@ -714,16 +772,17 @@ extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, /** * \brief Read pixels from the current rendering target. - * - * \param rect A pointer to the rectangle to read, or NULL for the entire + * + * \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, @@ -738,7 +797,7 @@ extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); /** * \brief Destroy the specified texture. - * + * * \sa SDL_CreateTexture() * \sa SDL_CreateTextureFromSurface() */ @@ -747,7 +806,7 @@ 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); @@ -777,9 +836,7 @@ extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_rwops.h b/include/SDL_rwops.h index 3ad1ae4b8..0461ff782 100644 --- a/include/SDL_rwops.h +++ b/include/SDL_rwops.h @@ -21,7 +21,7 @@ /** * \file SDL_rwops.h - * + * * This file provides a general interface for SDL to read and write * data streams. It can easily be extended to files, memory, etc. */ @@ -35,18 +35,16 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* 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 */ +#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. @@ -61,7 +59,7 @@ typedef struct SDL_RWops /** * 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, @@ -70,7 +68,7 @@ typedef struct SDL_RWops /** * 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, @@ -79,7 +77,7 @@ typedef struct SDL_RWops /** * 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, @@ -87,7 +85,7 @@ typedef struct SDL_RWops /** * 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); @@ -147,7 +145,7 @@ typedef struct SDL_RWops /** * \name RWFrom functions - * + * * Functions to create SDL_RWops structures from various data streams. */ /*@{*/ @@ -173,28 +171,28 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); -#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 */ +#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_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) +#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. */ /*@{*/ @@ -207,9 +205,9 @@ 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. */ /*@{*/ @@ -225,9 +223,7 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_scancode.h b/include/SDL_scancode.h index 26b8f36b5..d3f874811 100644 --- a/include/SDL_scancode.h +++ b/include/SDL_scancode.h @@ -21,7 +21,7 @@ /** * \file SDL_scancode.h - * + * * Defines keyboard scancodes. */ @@ -32,11 +32,11 @@ /** * \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 */ @@ -44,9 +44,9 @@ typedef enum { SDL_SCANCODE_UNKNOWN = 0, - /** + /** * \name Usage page 0x07 - * + * * These values are from usage page 0x07 (USB keyboard page). */ /*@{*/ @@ -99,49 +99,49 @@ typedef enum 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 + 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 + * 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 + 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 + * 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. + * 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 + 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 + * 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 + * SIGN in a Swiss German, German, or French Mac * layout on ANSI keyboards. */ SDL_SCANCODE_COMMA = 54, @@ -178,7 +178,7 @@ typedef enum SDL_SCANCODE_DOWN = 81, SDL_SCANCODE_UP = 82, - SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards + SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards */ SDL_SCANCODE_KP_DIVIDE = 84, SDL_SCANCODE_KP_MULTIPLY = 85, @@ -197,19 +197,19 @@ typedef enum 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. + 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 + * (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 + 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, @@ -245,7 +245,7 @@ typedef enum SDL_SCANCODE_KP_COMMA = 133, SDL_SCANCODE_KP_EQUALSAS400 = 134, - SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see + SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see footnotes in USB doc */ SDL_SCANCODE_INTERNATIONAL2 = 136, SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ @@ -334,16 +334,16 @@ typedef enum 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 + 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). */ /*@{*/ @@ -365,34 +365,34 @@ typedef enum 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 + 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, + + 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 + SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes for array bounds */ } SDL_Scancode; diff --git a/include/SDL_shape.h b/include/SDL_shape.h index bd3724241..63f850c94 100644 --- a/include/SDL_shape.h +++ b/include/SDL_shape.h @@ -31,9 +31,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** \file SDL_shape.h @@ -47,28 +45,28 @@ extern "C" { /** * \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 + * \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 + * \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: + * \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_SHOWN, ::SDL_WINDOW_RESIZABLE, + * ::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. - * + * ::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. + * \brief Return whether the given window is a shaped window. * * \param window The window to query for being shaped. * @@ -79,31 +77,31 @@ 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 + /** \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; + /** \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; + /** \brief The mode of these window-shape parameters. */ + WindowShapeMode mode; + /** \brief Window-shape parameters. */ + SDL_WindowShapeParams parameters; } SDL_WindowShapeMode; /** @@ -138,9 +136,7 @@ extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_Windo /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index db2a385ce..bc39c2a90 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -21,7 +21,7 @@ /** * \file SDL_stdinc.h - * + * * This is a general header that includes C language support. */ @@ -87,12 +87,12 @@ /** * The number of elements in an array. */ -#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) -#define SDL_TABLESIZE(table) SDL_arraysize(table) +#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). */ @@ -186,7 +186,7 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); /** \cond */ #ifndef DOXYGEN_SHOULD_IGNORE_THIS -#if !defined(__ANDROID__) +#if !defined(__ANDROID__) /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ typedef enum { @@ -201,9 +201,7 @@ SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif #if defined(HAVE_ALLOCA) && !defined(alloca) @@ -236,71 +234,17 @@ char *alloca(); #define SDL_stack_free(data) SDL_free(data) #endif - -/* SDL stdinc inline functions: - - The theory here is that by default we forcibly inline what we can, and your - app will use the inline version by default. However we expose a non-inline - version too, so the symbol is always available in the library even if your app - bypassed the inline version. The SDL_*_inline versions aren't guaranteed to - exist, so never call them directly; use SDL_* instead, and trust the system - to give you the right thing. - - The benefit here is that you can dlsym() these functions, which you - couldn't if you had macros, you can link against a foreign build of SDL - even if you configured differently, and you can drop the unconfigured SDL - headers into a project without #defining HAVE_MALLOC (etc) and still link. -*/ - extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); -#ifdef HAVE_MALLOC -SDL_FORCE_INLINE void *SDL_malloc_inline(size_t size) { return malloc(size); } -#define SDL_malloc SDL_malloc_inline -#endif - extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); -#ifdef HAVE_CALLOC -SDL_FORCE_INLINE void *SDL_calloc_inline(size_t nmemb, size_t size) { return calloc(nmemb, size); } -#define SDL_calloc SDL_calloc_inline -#endif - extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); -#ifdef HAVE_REALLOC -SDL_FORCE_INLINE void *SDL_realloc_inline(void *mem, size_t size) { return realloc(mem, size); } -#define SDL_realloc SDL_realloc_inline -#endif - extern DECLSPEC void SDLCALL SDL_free(void *mem); -#ifdef HAVE_FREE -SDL_FORCE_INLINE void SDL_free_inline(void *mem) { free(mem); } -#define SDL_free SDL_free_inline -#endif extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); -#ifdef HAVE_GETENV -SDL_FORCE_INLINE char *SDL_getenv_inline(const char *name) { return getenv(name); } -#define SDL_getenv SDL_getenv_inline -#endif - extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); -#ifdef HAVE_SETENV -SDL_FORCE_INLINE int SDL_setenv_inline(const char *name, const char *value, int overwrite) { return setenv(name, value, overwrite); } -#define SDL_setenv SDL_setenv_inline -#endif extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)); -#ifdef HAVE_QSORT -SDL_FORCE_INLINE void SDL_qsort_inline(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)) { qsort(base, nmemb, size, compare); } -#define SDL_qsort SDL_qsort_inline -#endif extern DECLSPEC int SDLCALL SDL_abs(int x); -#ifdef HAVE_ABS -SDL_FORCE_INLINE int SDL_abs_inline(int x) { return abs(x); } -#else -SDL_FORCE_INLINE int SDL_abs_inline(int x) { return ((x) < 0 ? -(x) : (x)); } -#endif -#define SDL_abs SDL_abs_inline /* !!! FIXME: these have side effects. You probably shouldn't use them. */ /* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */ @@ -311,33 +255,14 @@ 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_CTYPE_H -SDL_FORCE_INLINE int SDL_isdigit_inline(int x) { return isdigit(x); } -SDL_FORCE_INLINE int SDL_isspace_inline(int x) { return isspace(x); } -SDL_FORCE_INLINE int SDL_toupper_inline(int x) { return toupper(x); } -SDL_FORCE_INLINE int SDL_tolower_inline(int x) { return tolower(x); } -#else -SDL_FORCE_INLINE int SDL_isdigit_inline(int x) { return ((x) >= '0') && ((x) <= '9'); } -SDL_FORCE_INLINE int SDL_isspace_inline(int x) { return ((x) == ' ') || ((x) == '\t') || ((x) == '\r') || ((x) == '\n'); } -SDL_FORCE_INLINE int SDL_toupper_inline(int x) { return ((x) >= 'a') && ((x) <= 'z') ? ('A'+((x)-'a')) : (x); } -SDL_FORCE_INLINE int SDL_tolower_inline(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a'+((x)-'A')) : (x); } -#endif -#define SDL_isdigit SDL_isdigit_inline -#define SDL_isspace SDL_isspace_inline -#define SDL_toupper SDL_toupper_inline -#define SDL_tolower SDL_tolower_inline extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len); -#ifdef HAVE_MEMSET -SDL_FORCE_INLINE void *SDL_memset_inline(void *dst, int c, size_t len) { return memset(dst, c, len); } -#define SDL_memset SDL_memset_inline -#endif #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) #define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) -/* !!! FIXME: does this _really_ beat memset() on any modern platform? */ -SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t len) +/* 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; @@ -345,17 +270,16 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t len) "cld \n\t" "rep ; stosl \n\t" : "=&D" (u0), "=&a" (u1), "=&c" (u2) - : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) : "memory" ); -/* !!! FIXME: amd64? */ #else - size_t _n = (len + 3) / 4; + size_t _n = (dwords + 3) / 4; Uint32 *_p = SDL_static_cast(Uint32 *, dst); Uint32 _val = (val); - if (len == 0) + if (dwords == 0) return; - switch (len % 4) + switch (dwords % 4) { case 0: do { *_p++ = _val; case 3: *_p++ = _val; @@ -368,305 +292,54 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t len) extern DECLSPEC void *SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); -#if defined(__MACOSX__) -SDL_FORCE_INLINE void *SDL_memcpy_inline(void *dst, const void *src, size_t len) -{ - /* We can count on memcpy existing on Mac OS X and being well-tuned. */ - return memcpy(dst, src, len); -} -#define SDL_memcpy SDL_memcpy_inline -#elif defined(__GNUC__) && defined(i386) && !defined(__WIN32__) -SDL_FORCE_INLINE void *SDL_memcpy_inline(void *dst, const void *src, size_t len) -{ - /* !!! FIXME: does this _really_ beat memcpy() on any modern platform? */ - /* !!! FIXME: shouldn't we just force the inputs to ecx/edi/esi instead of this tapdance with outputs? */ - /* !!! FIXME: amd64? */ - 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" - ); - return dst; -} -#define SDL_memcpy SDL_memcpy_inline -#elif defined(HAVE_MEMCPY) -SDL_FORCE_INLINE void *SDL_memcpy_inline(void *dst, const void *src, size_t len) -{ - return memcpy(dst, src, len); -} -#define SDL_memcpy SDL_memcpy_inline -#elif defined(HAVE_BCOPY) /* !!! FIXME: is there _really_ ever a time where you have bcopy and not memcpy? */ -SDL_FORCE_INLINE void *SDL_memcpy_inline(void *dst, const void *src, size_t len) -{ - bcopy(src, dst, len); - return dst; -} -#define SDL_memcpy SDL_memcpy_inline -#endif - SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t dwords) { -#if defined(__GNUC__) && defined(i386) - /* !!! FIXME: does this _really_ beat memcpy() on any modern platform? */ - /* !!! FIXME: shouldn't we just force the inputs to ecx/edi/esi instead of this tapdance with outputs? */ - int ecx, edi, esi; - __asm__ __volatile__ ( - "cld \n\t" - "rep ; movsl \n\t" - : "=&c" (ecx), "=&D" (edi), "=&S" (esi) - : "0" (SDL_static_cast(unsigned, dwords)), "1" (dst), "2" (src) - : "memory" - ); - return dst; -#else return SDL_memcpy(dst, src, dwords * 4); -#endif } extern DECLSPEC void *SDLCALL SDL_memmove(void *dst, const void *src, size_t len); -#ifdef HAVE_MEMMOVE -SDL_FORCE_INLINE void *SDL_memmove_inline(void *dst, const void *src, size_t len) { return memmove(dst, src, len); } -#define SDL_memmove SDL_memmove_inline -#endif - extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); -#ifdef HAVE_MEMCMP -SDL_FORCE_INLINE int SDL_memcmp_inline(const void *s1, const void *s2, size_t len) { return memcmp(s1, s2, len); } -#define SDL_memcmp SDL_memcmp_inline -#endif - -extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); -#ifdef HAVE_STRLEN -SDL_FORCE_INLINE size_t SDL_strlen_inline(const char *str) { return strlen(str); } -#define SDL_strlen SDL_strlen_inline -#endif extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); -#ifdef HAVE_WCSLEN -SDL_FORCE_INLINE size_t SDL_wcslen_inline(const wchar_t *wstr) { return wcslen(wstr); } -#define SDL_wcslen SDL_wcslen_inline -#endif - extern DECLSPEC size_t SDLCALL SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen); -#ifdef HAVE_WCSLCPY -SDL_FORCE_INLINE size_t SDL_wcslcpy_inline(wchar_t *dst, const wchar_t *src, size_t maxlen) { return wcslcpy(dst, src, maxlen); } -#define SDL_wcslcpy SDL_wcslcpy_inline -#endif - extern DECLSPEC size_t SDLCALL SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen); -#ifdef HAVE_WCSLCAT -SDL_FORCE_INLINE size_t SDL_wcslcat_inline(wchar_t *dst, const wchar_t *src, size_t maxlen) { return wcslcat(dst, src, maxlen); } -#define SDL_wcslcat SDL_wcslcat_inline -#endif +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); -#ifdef HAVE_STRLCPY -SDL_FORCE_INLINE size_t SDL_strlcpy_inline(char *dst, const char *src, size_t maxlen) { return strlcpy(dst, src, maxlen); } -#define SDL_strlcpy SDL_strlcpy_inline -#else -#endif - 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); -#ifdef HAVE_STRLCAT -SDL_FORCE_INLINE size_t SDL_strlcat_inline(char *dst, const char *src, size_t maxlen) { return strlcat(dst, src, maxlen); } -#define SDL_strlcat SDL_strlcat_inline -#endif - extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); -#ifdef HAVE_STRDUP -SDL_FORCE_INLINE char *SDL_strdup_inline(const char *str) { return strdup(str); } -#define SDL_strdup SDL_strdup_inline -#endif - extern DECLSPEC char *SDLCALL SDL_strrev(char *str); -#ifdef HAVE__STRREV -SDL_FORCE_INLINE char *SDL_strrev_inline(char *str) { return _strrev(str); } -#define SDL_strrev SDL_strrev_inline -#endif - extern DECLSPEC char *SDLCALL SDL_strupr(char *str); -#ifdef HAVE__STRUPR -SDL_FORCE_INLINE char *SDL_strupr_inline(char *str) { return _strupr(str); } -#define SDL_strupr SDL_strupr_inline -#endif - extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); -#ifdef HAVE__STRLWR -SDL_FORCE_INLINE char *SDL_strlwr_inline(char *str) { return _strlwr(str); } -#define SDL_strlwr SDL_strlwr_inline -#endif - extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); -#ifdef HAVE_STRCHR -SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) { return SDL_const_cast(char*,strchr(str, c)); } -#define SDL_strchr SDL_strchr_inline -#elif defined(HAVE_INDEX) /* !!! FIXME: is there anywhere that has this but not strchr? */ -SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) { return SDL_const_cast(char*,index(str, c)); } -#define SDL_strchr SDL_strchr_inline -#endif - extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); -#ifdef HAVE_STRRCHR -SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) { return SDL_const_cast(char*,strrchr(str, c)); } -#define SDL_strrchr SDL_strrchr_inline -#elif defined(HAVE_RINDEX) /* !!! FIXME: is there anywhere that has this but not strrchr? */ -SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) { return SDL_const_cast(char*,rindex(str, c)); } -#define SDL_strrchr SDL_strrchr_inline -#endif - extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); -#ifdef HAVE_STRSTR -SDL_FORCE_INLINE char *SDL_strstr_inline(const char *haystack, const char *needle) { return SDL_const_cast(char*,strstr(haystack, needle)); } -#define SDL_strstr SDL_strstr_inline -#endif - -extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); -#ifdef HAVE__LTOA -SDL_FORCE_INLINE char *SDL_ltoa_inline(long value, char *str, int radix) { return _ltoa(value, str, radix); } -#define SDL_ltoa SDL_ltoa_inline -#endif extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); -#ifdef HAVE_ITOA -SDL_FORCE_INLINE char *SDL_itoa_inline(int value, char *str, int radix) { return itoa(value, str, radix); } -#else -SDL_FORCE_INLINE char *SDL_itoa_inline(int value, char *str, int radix) { return SDL_ltoa((long)value, str, radix); } -#endif -#define SDL_itoa SDL_itoa_inline - -extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); -#ifdef HAVE__ULTOA -SDL_FORCE_INLINE char *SDL_ultoa_inline(unsigned long value, char *str, int radix) { return _ultoa(value, str, radix); } -#define SDL_ultoa SDL_ultoa_inline -#endif - extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); -#ifdef HAVE__UITOA -SDL_FORCE_INLINE char *SDL_uitoa_inline(unsigned int value, char *str, int radix) { return _uitoa(value, str, radix); } -#else -SDL_FORCE_INLINE char *SDL_uitoa_inline(unsigned int value, char *str, int radix) { return SDL_ultoa((unsigned long)value, str, radix); } -#endif -#define SDL_uitoa SDL_uitoa_inline - - -extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); -#ifdef HAVE_STRTOL -SDL_FORCE_INLINE long SDL_strtol_inline(const char *str, char **endp, int base) { return strtol(str, endp, base); } -#define SDL_strtol SDL_strtol_inline -#endif - -extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); -#ifdef HAVE_STRTOUL -SDL_FORCE_INLINE unsigned long SDLCALL SDL_strtoul_inline(const char *str, char **endp, int base) { return strtoul(str, endp, base); } -#define SDL_strtoul SDL_strtoul_inline -#endif - +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); -#ifdef HAVE__I64TOA -SDL_FORCE_INLINE char *SDL_lltoa_inline(Sint64 value, char *str, int radix) { return _i64toa(value, str, radix); } -#define SDL_lltoa SDL_lltoa_inline -#endif - extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); -#ifdef HAVE__UI64TOA -SDL_FORCE_INLINE char *SDL_ulltoa_inline(Uint64 value, char *str, int radix) { return _ui64toa(value, str, radix); } -#define SDL_ulltoa SDL_ulltoa_inline -#endif - -extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); -#ifdef HAVE_STRTOLL -SDL_FORCE_INLINE Sint64 SDL_strtoll_inline(const char *str, char **endp, int base) { return strtoll(str, endp, base); } -#define SDL_strtoll SDL_strtoll_inline -#endif - -extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); -#ifdef HAVE_STRTOULL -SDL_FORCE_INLINE Uint64 SDL_strtoull_inline(const char *str, char **endp, int base) { return strtoull(str, endp, base); } -#define SDL_strtoull SDL_strtoull_inline -#endif - -extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); -#ifdef HAVE_STRTOD -SDL_FORCE_INLINE double SDL_strtod_inline(const char *str, char **endp) { return strtod(str, endp); } -#define SDL_strtod SDL_strtod_inline -#endif extern DECLSPEC int SDLCALL SDL_atoi(const char *str); -#ifdef HAVE_ATOI -SDL_FORCE_INLINE int SDL_atoi_inline(const char *str) { return atoi(str); } -#else -SDL_FORCE_INLINE int SDL_atoi_inline(const char *str) { return SDL_strtol(str, NULL, 0); } -#endif -#define SDL_atoi SDL_atoi_inline - extern DECLSPEC double SDLCALL SDL_atof(const char *str); -#ifdef HAVE_ATOF -SDL_FORCE_INLINE double SDL_atof_inline(const char *str) { return (double) atof(str); } -#else -SDL_FORCE_INLINE double SDL_atof_inline(const char *str) { return SDL_strtod(str, NULL); } -#endif -#define SDL_atof SDL_atof_inline - +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); extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); -#ifdef HAVE_STRCMP -SDL_FORCE_INLINE int SDL_strcmp_inline(const char *str1, const char *str2) { return strcmp(str1, str2); } -#define SDL_strcmp SDL_strcmp_inline -#endif - extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); -#ifdef HAVE_STRNCMP -SDL_FORCE_INLINE int SDL_strncmp_inline(const char *str1, const char *str2, size_t maxlen) { return strncmp(str1, str2, maxlen); } -#define SDL_strncmp SDL_strncmp_inline -#endif - extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); -#ifdef HAVE_STRCASECMP -SDL_FORCE_INLINE int SDL_strcasecmp_inline(const char *str1, const char *str2) { return strcasecmp(str1, str2); } -#define SDL_strcasecmp SDL_strcasecmp_inline -#elif defined(HAVE__STRICMP) -SDL_FORCE_INLINE int SDL_strcasecmp_inline(const char *str1, const char *str2) { return _stricmp(str1, str2); } -#define SDL_strcasecmp SDL_strcasecmp_inline -#endif - extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); -#ifdef HAVE_STRNCASECMP -SDL_FORCE_INLINE int SDL_strncasecmp_inline(const char *str1, const char *str2, size_t len) { return strncasecmp(str1, str2, len); } -#define SDL_strncasecmp SDL_strncasecmp_inline -#elif defined(HAVE__STRNICMP) -SDL_FORCE_INLINE int SDL_strncasecmp_inline(const char *str1, const char *str2, size_t len) { return _strnicmp(str1, str2, len); } -#define SDL_strncasecmp SDL_strncasecmp_inline -#endif -/* Not doing SDL_*_inline functions for these, because of the varargs. */ extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); -#ifdef HAVE_SSCANF -#define SDL_sscanf sscanf -#endif - extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); -#ifdef HAVE_SNPRINTF -#define SDL_snprintf snprintf -#endif - extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); -#ifdef HAVE_VSNPRINTF -SDL_FORCE_INLINE int SDL_vsnprintf_inline(char *text, size_t maxlen, const char *fmt, va_list ap) { return vsnprintf(text, maxlen, fmt, ap); } -#define SDL_vsnprintf SDL_vsnprintf_inline -#endif #ifndef HAVE_M_PI #ifndef M_PI @@ -675,100 +348,25 @@ SDL_FORCE_INLINE int SDL_vsnprintf_inline(char *text, size_t maxlen, const char #endif extern DECLSPEC double SDLCALL SDL_atan(double x); -#ifdef HAVE_ATAN -SDL_FORCE_INLINE double SDL_atan_inline(double x) { return atan(x); } -#define SDL_atan SDL_atan_inline -#endif - extern DECLSPEC double SDLCALL SDL_atan2(double x, double y); -#ifdef HAVE_ATAN2 -SDL_FORCE_INLINE double SDL_atan2_inline(double x, double y) { return atan2(x, y); } -#define SDL_atan2 SDL_atan2_inline -#endif - extern DECLSPEC double SDLCALL SDL_ceil(double x); -#ifdef HAVE_CEIL -SDL_FORCE_INLINE double SDL_ceil_inline(double x) { return ceil(x); } -#else -SDL_FORCE_INLINE double SDL_ceil_inline(double x) { return (double)(int)((x)+0.5); } -#endif -#define SDL_ceil SDL_ceil_inline - extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); -#ifdef HAVE_COPYSIGN -SDL_FORCE_INLINE double SDL_copysign_inline(double x, double y) { return copysign(x, y); } -#define SDL_copysign SDL_copysign_inline -#endif - extern DECLSPEC double SDLCALL SDL_cos(double x); -#ifdef HAVE_COS -SDL_FORCE_INLINE double SDL_cos_inline(double x) { return cos(x); } -#define SDL_cos SDL_cos_inline -#endif - extern DECLSPEC float SDLCALL SDL_cosf(float x); -#ifdef HAVE_COSF -SDL_FORCE_INLINE float SDL_cosf_inline(float x) { return cosf(x); } -#else -SDL_FORCE_INLINE float SDL_cosf_inline(float x) { return (float)SDL_cos((double)x); } -#endif -#define SDL_cosf SDL_cosf_inline - extern DECLSPEC double SDLCALL SDL_fabs(double x); -#ifdef HAVE_FABS -SDL_FORCE_INLINE double SDL_fabs_inline(double x) { return fabs(x); } -#define SDL_fabs SDL_fabs_inline -#endif - extern DECLSPEC double SDLCALL SDL_floor(double x); -#ifdef HAVE_FLOOR -SDL_FORCE_INLINE double SDL_floor_inline(double x) { return floor(x); } -#define SDL_floor SDL_floor_inline -#endif - extern DECLSPEC double SDLCALL SDL_log(double x); -#ifdef HAVE_LOG -SDL_FORCE_INLINE double SDL_log_inline(double x) { return log(x); } -#define SDL_log SDL_log_inline -#endif - extern DECLSPEC double SDLCALL SDL_pow(double x, double y); -#ifdef HAVE_POW -SDL_FORCE_INLINE double SDL_pow_inline(double x, double y) { return pow(x, y); } -#define SDL_pow SDL_pow_inline -#endif - extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); -#ifdef HAVE_SCALBN -SDL_FORCE_INLINE double SDL_scalbn_inline(double x, int n) { return scalbn(x, n); } -#define SDL_scalbn SDL_scalbn_inline -#endif - extern DECLSPEC double SDLCALL SDL_sin(double x); -#ifdef HAVE_SIN -SDL_FORCE_INLINE double SDL_sin_inline(double x) { return sin(x); } -#define SDL_sin SDL_sin_inline -#endif - extern DECLSPEC float SDLCALL SDL_sinf(float x); -#ifdef HAVE_SINF -SDL_FORCE_INLINE float SDL_sinf_inline(float x) { return sinf(x); } -#else -SDL_FORCE_INLINE float SDL_sinf_inline(float x) { return (float)SDL_sin((double)x); } -#endif -#define SDL_sinf SDL_sinf_inline - extern DECLSPEC double SDLCALL SDL_sqrt(double x); -#ifdef HAVE_SQRT -SDL_FORCE_INLINE double SDL_sqrt_inline(double x) { return sqrt(x); } -#define SDL_sqrt SDL_sqrt_inline -#endif /* 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 +#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; @@ -786,15 +384,13 @@ 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) +#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 -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_surface.h b/include/SDL_surface.h index 275beb645..fece79743 100644 --- a/include/SDL_surface.h +++ b/include/SDL_surface.h @@ -21,8 +21,8 @@ /** * \file SDL_surface.h - * - * Header file for ::SDL_surface definition and management functions. + * + * Header file for ::SDL_Surface definition and management functions. */ #ifndef _SDL_surface_h @@ -37,16 +37,14 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * \name Surface flags - * - * These are the currently supported flags for the ::SDL_surface. - * + * + * These are the currently supported flags for the ::SDL_Surface. + * * \internal * Used internally (read-only). */ @@ -60,7 +58,7 @@ extern "C" { /** * Evaluates to true if the surface needs to be locked before access. */ -#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) +#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) /** * \brief A collection of pixels used in software blitting. @@ -101,14 +99,21 @@ typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, /** * 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, @@ -126,9 +131,9 @@ 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, @@ -136,21 +141,21 @@ extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, /** * \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 + * 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); @@ -159,11 +164,11 @@ 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, @@ -171,34 +176,34 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, /** * Load a surface from a file. - * + * * Convenience macro. */ -#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) +#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) + 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. */ @@ -207,11 +212,11 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, /** * \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. @@ -221,12 +226,12 @@ extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, /** * \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 + * \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 + * + * \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, @@ -234,14 +239,14 @@ extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, /** * \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, @@ -250,14 +255,14 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, /** * \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, @@ -266,12 +271,12 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, /** * \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, @@ -279,12 +284,12 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, /** * \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, @@ -292,12 +297,12 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, /** * \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, @@ -305,12 +310,12 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, /** * \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, @@ -318,14 +323,14 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, /** * 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. */ @@ -334,7 +339,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, /** * 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. */ @@ -342,11 +347,11 @@ 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 + * 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 + * + * 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. @@ -358,7 +363,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat /** * \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, @@ -369,12 +374,12 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, /** * 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 + * + * 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 @@ -384,60 +389,58 @@ extern DECLSPEC int SDLCALL SDL_FillRects /** * 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 alpha and colorkey + * The blit semantics for surfaces with and without blending and colorkey * are defined as follows: * \verbatim RGBA->RGB: - SDL_SRCALPHA set: - alpha-blend (using alpha-channel). + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) SDL_SRCCOLORKEY ignored. - SDL_SRCALPHA not set: + 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 colour key, ignoring alpha in the + RGB values of the source color 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: + 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 colour key. - + source color key. + RGBA->RGBA: - SDL_SRCALPHA set: - alpha-blend (using the source alpha channel) the RGB values; - leave destination alpha untouched. [Note: is this correct?] + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) SDL_SRCCOLORKEY ignored. - SDL_SRCALPHA not set: + 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 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: + 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 colour key. + 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. */ @@ -462,7 +465,7 @@ extern DECLSPEC int SDLCALL SDL_LowerBlit /** * \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, @@ -491,9 +494,7 @@ extern DECLSPEC int SDLCALL SDL_LowerBlitScaled /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_system.h b/include/SDL_system.h index 99ca46383..cb7490664 100644 --- a/include/SDL_system.h +++ b/include/SDL_system.h @@ -21,7 +21,7 @@ /** * \file SDL_system.h - * + * * Include file for platform specific SDL API functions */ @@ -38,9 +38,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* Platform specific functions for iOS */ @@ -62,6 +60,9 @@ 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(); @@ -160,9 +161,7 @@ extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathT /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index c01c27141..3b503ae74 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -21,7 +21,7 @@ /** * \file SDL_syswm.h - * + * * Include file for SDL custom system window manager hooks. */ @@ -36,14 +36,12 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * \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 @@ -100,7 +98,7 @@ typedef struct _UIViewController UIViewController; #endif #endif -/** +/** * These are the various supported windowing subsystems */ typedef enum @@ -222,19 +220,19 @@ typedef struct SDL_SysWMinfo SDL_SysWMinfo; /* Function prototypes */ /** * \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 + * \param info This structure must be initialized with the SDL version, and is * then filled in with information about the given window. - * - * \return SDL_TRUE if the function is implemented and the version member of + * + * \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(&info) ) { ... } + * if ( SDL_GetWindowWMInfo(window, &info) ) { ... } * \endcode */ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, @@ -243,9 +241,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test.h b/include/SDL_test.h index 15e7689f0..7e0de0894 100644 --- a/include/SDL_test.h +++ b/include/SDL_test.h @@ -21,7 +21,7 @@ /** * \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. @@ -46,24 +46,20 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #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. +/* + * 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 +#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_assert.h b/include/SDL_test_assert.h index 17b6d26b6..beba16f5e 100644 --- a/include/SDL_test_assert.h +++ b/include/SDL_test_assert.h @@ -21,13 +21,13 @@ /** * \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 * @@ -39,20 +39,18 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * \brief Fails the assert. */ -#define ASSERT_FAIL 0 +#define ASSERT_FAIL 0 /** * \brief Passes the assert. */ -#define ASSERT_PASS 1 +#define ASSERT_PASS 1 /** * \brief Assert that logs and break execution flow on failures. @@ -98,9 +96,7 @@ void SDLTest_LogAssertSummary(); int SDLTest_AssertSummaryToTestResult(); #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_common.h b/include/SDL_test_common.h index 9e9122f1b..f07acf7c1 100644 --- a/include/SDL_test_common.h +++ b/include/SDL_test_common.h @@ -21,7 +21,7 @@ /** * \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. @@ -69,6 +69,9 @@ typedef struct 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; @@ -104,14 +107,13 @@ typedef struct 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 -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* Function prototypes */ @@ -175,9 +177,7 @@ void SDLTest_CommonQuit(SDLTest_CommonState * state); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_compare.h b/include/SDL_test_compare.h index e145f6908..98ca8ce81 100644 --- a/include/SDL_test_compare.h +++ b/include/SDL_test_compare.h @@ -21,16 +21,16 @@ /** * \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 @@ -43,9 +43,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -58,13 +56,11 @@ extern "C" { * \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 -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_crc32.h b/include/SDL_test_crc32.h index 0685a37f4..f0a84a48c 100644 --- a/include/SDL_test_crc32.h +++ b/include/SDL_test_crc32.h @@ -21,16 +21,16 @@ /** * \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 @@ -39,9 +39,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif @@ -50,20 +48,20 @@ extern "C" { /* Definition shared by all CRC routines */ #ifndef CrcUint32 - #define CrcUint32 unsigned int + #define CrcUint32 unsigned int #endif #ifndef CrcUint8 - #define CrcUint8 unsigned char + #define CrcUint8 unsigned char #endif #ifdef ORIGINAL_METHOD - #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ + #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ #else #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ #endif -/** - * Data structure for CRC32 (checksum) computation +/** + * Data structure for CRC32 (checksum) computation */ typedef struct { CrcUint32 crc32_table[256]; /* CRC table */ @@ -71,12 +69,12 @@ extern "C" { /* ---------- 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 + * /param crcContext pointer to context variable * * /returns 0 for OK, -1 on error * @@ -86,8 +84,8 @@ extern "C" { /** * /brief calculate a crc32 from a data block - * - * /param crcContext pointer to context variable + * + * /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 @@ -106,7 +104,7 @@ int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, /** * /brief clean up CRC context * - * /param crcContext pointer to context variable + * /param crcContext pointer to context variable * * /returns 0 for OK, -1 on error * @@ -117,9 +115,7 @@ int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_font.h b/include/SDL_test_font.h index d894601f1..aa9286b4a 100644 --- a/include/SDL_test_font.h +++ b/include/SDL_test_font.h @@ -21,7 +21,7 @@ /** * \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. @@ -33,9 +33,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* Function prototypes */ @@ -55,9 +53,7 @@ int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_fuzzer.h b/include/SDL_test_fuzzer.h index db30a1dfb..a528ddc5e 100644 --- a/include/SDL_test_fuzzer.h +++ b/include/SDL_test_fuzzer.h @@ -21,16 +21,16 @@ /** * \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 @@ -39,9 +39,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif @@ -131,7 +129,7 @@ Sint64 SDLTest_RandomSint64(); float SDLTest_RandomUnitFloat(); /** - * \returns random double in range [0.0 - 1.0[ + * \returns random double in range [0.0 - 1.0[ */ double SDLTest_RandomUnitDouble(); @@ -333,7 +331,7 @@ 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 + * 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. @@ -352,7 +350,7 @@ char * SDLTest_RandomAsciiString(); * * \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. + * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated. */ char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); @@ -377,9 +375,7 @@ int SDLTest_GetFuzzerInvocationCount(); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_harness.h b/include/SDL_test_harness.h index e5fe673af..d2da04f1e 100644 --- a/include/SDL_test_harness.h +++ b/include/SDL_test_harness.h @@ -21,7 +21,7 @@ /** * \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. @@ -29,7 +29,7 @@ /* Defines types for test case definitions and the test execution harness API. - + Based on original GSOC code by Markus Kauppila */ @@ -39,9 +39,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif @@ -50,22 +48,23 @@ extern "C" { #define TEST_DISABLED 0 //! Definition of all the possible test return values of the test case method -#define TEST_ABORTED -1 -#define TEST_COMPLETED 0 -#define TEST_SKIPPED 1 +#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 +#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 void (*SDLTest_TestCaseFp)(void *arg); +typedef int (*SDLTest_TestCaseFp)(void *arg); //!< Function pointer to a test case teardown function (run after every test) typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); @@ -74,28 +73,28 @@ 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; + /*!< 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; + /*!< "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; @@ -111,13 +110,11 @@ typedef struct SDLTest_TestSuiteReference { * \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 -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_images.h b/include/SDL_test_images.h index ea7222928..21cf39ff7 100644 --- a/include/SDL_test_images.h +++ b/include/SDL_test_images.h @@ -21,16 +21,16 @@ /** * \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 @@ -41,9 +41,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -52,7 +50,7 @@ extern "C" { typedef struct SDLTest_SurfaceImage_s { int width; int height; - unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ + unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ const char *pixel_data; } SDLTest_SurfaceImage_t; @@ -71,9 +69,7 @@ SDL_Surface *SDLTest_ImagePrimitivesBlend(); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_log.h b/include/SDL_test_log.h index c6dbad653..a581d2e75 100644 --- a/include/SDL_test_log.h +++ b/include/SDL_test_log.h @@ -21,13 +21,13 @@ /** * \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 * @@ -39,9 +39,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** @@ -60,9 +58,7 @@ void SDLTest_LogError(const char *fmt, ...); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_md5.h b/include/SDL_test_md5.h index 8949f4b0e..b0d4b7b04 100644 --- a/include/SDL_test_md5.h +++ b/include/SDL_test_md5.h @@ -21,7 +21,7 @@ /** * \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. @@ -59,9 +59,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* ------------ Definitions --------- */ @@ -71,21 +69,21 @@ extern "C" { /* 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 */ + 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 + * /param mdContext pointer to context variable * * Note: The function initializes the message-digest context - * mdContext. Call before each new use of the context - + * mdContext. Call before each new use of the context - * all fields are set to zero. */ void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); @@ -93,24 +91,24 @@ extern "C" { /** * /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 + * 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); + unsigned int inLen); /* * /brief complete digest computation * - * /param mdContext pointer to context variable + * /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]. @@ -122,9 +120,7 @@ extern "C" { /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_test_random.h b/include/SDL_test_random.h index 8b20b6ade..ce6192c25 100644 --- a/include/SDL_test_random.h +++ b/include/SDL_test_random.h @@ -21,20 +21,20 @@ /** * \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. + 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 @@ -43,9 +43,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* --- Definitions */ @@ -53,7 +51,7 @@ extern "C" { /* * Macros that return a random number in a specific format. */ -#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) +#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) /* * Context structure for the random number generator state. @@ -70,7 +68,7 @@ extern "C" { /* --- Function prototypes */ /** - * \brief Initialize random number generator with two integers. + * \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. @@ -81,10 +79,10 @@ extern "C" { * */ void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, - unsigned int ci); + unsigned int ci); /** - * \brief Initialize random number generator based on current system time. + * \brief Initialize random number generator based on current system time. * * \param rndContext pointer to context structure * @@ -93,7 +91,7 @@ extern "C" { /** - * \brief Initialize random number generator based on current system time. + * \brief Initialize random number generator based on current system time. * * Note: ...RandomInit() or ...RandomInitTime() must have been called * before using this function. @@ -108,9 +106,7 @@ extern "C" { /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_thread.h b/include/SDL_thread.h index 273419b22..c878c3ab9 100644 --- a/include/SDL_thread.h +++ b/include/SDL_thread.h @@ -24,7 +24,7 @@ /** * \file SDL_thread.h - * + * * Header for the SDL thread management routines. */ @@ -32,14 +32,13 @@ #include "SDL_error.h" /* Thread synchronization primitives */ +#include "SDL_atomic.h" #include "SDL_mutex.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /* The SDL thread structure, defined in SDL_thread.c */ @@ -49,6 +48,9 @@ typedef struct SDL_Thread SDL_Thread; /* 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. @@ -67,22 +69,22 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data); #if defined(__WIN32__) && !defined(HAVE_LIBC) /** * \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 + * 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 + * Always use the _beginthread() and _endthread() of the calling runtime * library! */ #define SDL_PASSED_BEGINTHREAD_ENDTHREAD @@ -107,7 +109,7 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, /** * Create a thread. */ -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, _beginthreadex, _endthreadex) +#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) #else @@ -150,7 +152,7 @@ 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); @@ -162,18 +164,74 @@ extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); /** * Wait for a thread to finish. - * + * * The return code for the thread function is placed in the area * pointed to by \c status, if \c status is not NULL. */ extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); +/** + * \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++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_timer.h b/include/SDL_timer.h index 4a2a27251..e065cf4f9 100644 --- a/include/SDL_timer.h +++ b/include/SDL_timer.h @@ -24,7 +24,7 @@ /** * \file SDL_timer.h - * + * * Header for the SDL time management routines. */ @@ -34,14 +34,12 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * \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); @@ -63,7 +61,7 @@ extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); /** * 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 @@ -97,9 +95,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_touch.h b/include/SDL_touch.h index 55176a1d9..9e6d7c65f 100644 --- a/include/SDL_touch.h +++ b/include/SDL_touch.h @@ -21,7 +21,7 @@ /** * \file SDL_touch.h - * + * * Include file for SDL touch event handling. */ @@ -35,9 +35,7 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif typedef Sint64 SDL_TouchID; @@ -60,7 +58,7 @@ typedef struct SDL_Finger /** * \brief Get the number of registered touch devices. */ -extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(); +extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); /** * \brief Get the touch ID with the given index, or 0 if the index is invalid. @@ -79,9 +77,7 @@ extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_types.h b/include/SDL_types.h index 636df1e9e..bb485cdb0 100644 --- a/include/SDL_types.h +++ b/include/SDL_types.h @@ -21,7 +21,7 @@ /** * \file SDL_types.h - * + * * \deprecated */ diff --git a/include/SDL_version.h b/include/SDL_version.h index e32ea20b2..a9ced804d 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -21,7 +21,7 @@ /** * \file SDL_version.h - * + * * This header defines the current SDL version. */ @@ -33,20 +33,18 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * \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 */ @@ -59,30 +57,30 @@ typedef struct SDL_version /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ -#define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 0 -#define SDL_PATCHLEVEL 0 +#define SDL_MAJOR_VERSION 2 +#define SDL_MINOR_VERSION 0 +#define SDL_PATCHLEVEL 0 /** * \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; \ } /** @@ -90,23 +88,23 @@ typedef struct SDL_version * \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. */ #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. */ #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. @@ -115,11 +113,11 @@ typedef struct SDL_version * 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", @@ -127,9 +125,9 @@ typedef struct SDL_version * 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); @@ -155,9 +153,7 @@ extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/SDL_video.h b/include/SDL_video.h index 4873da39b..f3a961977 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.h @@ -21,7 +21,7 @@ /** * \file SDL_video.h - * + * * Header file for SDL video functions. */ @@ -36,14 +36,12 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ extern "C" { -/* *INDENT-ON* */ #endif /** * \brief The structure that defines a display mode - * + * * \sa SDL_GetNumDisplayModes() * \sa SDL_GetDisplayMode() * \sa SDL_GetDesktopDisplayMode() @@ -63,7 +61,7 @@ typedef struct /** * \brief The type used to identify a window - * + * * \sa SDL_CreateWindow() * \sa SDL_CreateWindowFrom() * \sa SDL_DestroyWindow() @@ -92,7 +90,7 @@ typedef struct SDL_Window SDL_Window; /** * \brief The flags on a window - * + * * \sa SDL_GetWindowFlags() */ typedef enum @@ -108,7 +106,7 @@ typedef enum 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_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), SDL_WINDOW_FOREIGN = 0x00000800 /**< window not created by SDL */ } SDL_WindowFlags; @@ -138,9 +136,9 @@ 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 + SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be redrawn */ - SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 + 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. */ @@ -152,7 +150,7 @@ typedef enum 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 + SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the window be closed */ } SDL_WindowEventID; @@ -211,52 +209,52 @@ typedef enum /** * \brief Get the number of video drivers compiled into SDL - * + * * \sa SDL_GetVideoDriver() */ extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); /** * \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. - * + * * \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 + * + * \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 void SDLCALL SDL_VideoQuit(void); /** * \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() */ @@ -264,16 +262,16 @@ 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); @@ -281,29 +279,29 @@ 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 int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, @@ -322,21 +320,22 @@ extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_Disp /** * \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 + * \param closest A pointer to a display mode to be filled in with the closest * match of the available display modes. - * - * \return The passed in value \c closest, or NULL if no matching video mode + * + * \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 + * 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() */ @@ -344,7 +343,7 @@ extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayI /** * \brief Get the display index associated with a window. - * + * * \return the display index of the display containing the center of the * window, or -1 on error. */ @@ -355,11 +354,12 @@ extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); * * By default the window's dimensions and the desktop format and refresh rate * are used. - * + * + * \param window The window for which the display mode should be set. * \param mode The mode to use, or NULL for the default mode. - * + * * \return 0 on success, or -1 if setting the display mode failed. - * + * * \sa SDL_GetWindowDisplayMode() * \sa SDL_SetWindowFullscreen() */ @@ -384,22 +384,22 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); /** * \brief Create a window 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 + * \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 + * \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_SHOWN, ::SDL_WINDOW_BORDERLESS, - * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, + * \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. - * + * * \return The id of the window created, or zero if window creation failed. - * + * * \sa SDL_DestroyWindow() */ extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, @@ -408,11 +408,11 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, /** * \brief Create an SDL window from an existing native window. - * + * * \param data A pointer to driver-dependent window creation data - * + * * \return The id of the window created, or zero if window creation failed. - * + * * \sa SDL_DestroyWindow() */ extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); @@ -434,7 +434,7 @@ 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, @@ -442,14 +442,15 @@ extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, /** * \brief Get the title of a window, in UTF-8 format. - * + * * \sa SDL_SetWindowTitle() */ extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); /** * \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 void SDLCALL SDL_SetWindowIcon(SDL_Window * window, @@ -457,7 +458,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, /** * \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. @@ -474,12 +475,12 @@ extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, /** * \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, @@ -487,15 +488,15 @@ extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, /** * \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, @@ -503,7 +504,8 @@ extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, /** * \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 * @@ -514,13 +516,14 @@ extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, /** * \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 void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, @@ -528,18 +531,20 @@ extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, /** * \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 void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, int *h); - + /** * \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 * @@ -551,13 +556,14 @@ extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, */ extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h); - + /** * \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() */ @@ -567,6 +573,7 @@ extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, /** * \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 * @@ -578,10 +585,11 @@ extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, */ extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h); - + /** * \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 * @@ -602,7 +610,7 @@ extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, * \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_SetWindowBordered(SDL_Window * window, @@ -610,14 +618,14 @@ extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, /** * \brief Show a window. - * + * * \sa SDL_HideWindow() */ extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); /** * \brief Hide a window. - * + * * \sa SDL_ShowWindow() */ extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); @@ -629,21 +637,21 @@ extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); /** * \brief Make a window as large as possible. - * + * * \sa SDL_RestoreWindow() */ extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); /** * \brief Minimize a window to an iconic representation. - * + * * \sa SDL_RestoreWindow() */ extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); /** * \brief Restore the size and position of a minimized or maximized window. - * + * * \sa SDL_MaximizeWindow() * \sa SDL_MinimizeWindow() */ @@ -651,9 +659,9 @@ extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); /** * \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() */ @@ -663,7 +671,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, /** * \brief Get the SDL surface associated with the window. * - * \return The window's framebuffer surface, or NULL on error. + * \return The window's framebuffer surface, or NULL on error. * * 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. @@ -699,9 +707,10 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, /** * \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, @@ -709,18 +718,18 @@ extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, /** * \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 SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); /** * \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() */ @@ -728,22 +737,23 @@ extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float b /** * \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); /** * \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. @@ -759,16 +769,17 @@ extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, /** * \brief Get the gamma ramp for a window. - * - * \param red A pointer to a 256 element array of 16-bit quantities to hold + * + * \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 + * \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 + * \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. - * + * * \sa SDL_SetWindowGammaRamp() */ extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, @@ -784,7 +795,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); /** * \brief Returns whether the screensaver is currently enabled (default on). - * + * * \sa SDL_EnableScreenSaver() * \sa SDL_DisableScreenSaver() */ @@ -792,7 +803,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); /** * \brief Allow the screen to be blanked by a screensaver - * + * * \sa SDL_IsScreenSaverEnabled() * \sa SDL_DisableScreenSaver() */ @@ -800,7 +811,7 @@ extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); /** * \brief Prevent the screen from being blanked by a screensaver - * + * * \sa SDL_IsScreenSaverEnabled() * \sa SDL_EnableScreenSaver() */ @@ -814,19 +825,19 @@ extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); /** * \brief Dynamically load an OpenGL library. - * - * \param path The platform dependent OpenGL library name, or NULL to open the + * + * \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() */ @@ -839,13 +850,13 @@ extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); /** * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). - * + * * \sa SDL_GL_LoadLibrary() */ extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); /** - * \brief Return true if an OpenGL extension is supported for the current + * \brief Return true if an OpenGL extension is supported for the current * context. */ extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char @@ -862,9 +873,9 @@ extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); /** - * \brief Create an OpenGL context for use with an OpenGL window, and make it + * \brief Create an OpenGL context for use with an OpenGL window, and make it * current. - * + * * \sa SDL_GL_DeleteContext() */ extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * @@ -872,48 +883,58 @@ extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * /** * \brief Set up an OpenGL context for rendering into an OpenGL window. - * + * * \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. - * + * * \return 0 on success, or -1 if setting the swap interval is not supported. - * + * * \sa SDL_GL_GetSwapInterval() */ extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); /** * \brief Get the swap interval for the current OpenGL context. - * - * \return 0 if there is no vertical retrace synchronization, 1 if the buffer + * + * \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. - * + * * \sa SDL_GL_SetSwapInterval() */ extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); /** - * \brief Swap the OpenGL buffers for a window, if double-buffering is + * \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); @@ -923,9 +944,7 @@ extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); /* Ends C function definitions when using C++ */ #ifdef __cplusplus -/* *INDENT-OFF* */ } -/* *INDENT-ON* */ #endif #include "close_code.h" diff --git a/include/begin_code.h b/include/begin_code.h index 0a4b4a65c..8997a7220 100644 --- a/include/begin_code.h +++ b/include/begin_code.h @@ -37,23 +37,23 @@ #ifndef DECLSPEC # if defined(__BEOS__) || defined(__HAIKU__) # if defined(__GNUC__) -# define DECLSPEC __declspec(dllexport) +# define DECLSPEC __declspec(dllexport) # else -# define DECLSPEC __declspec(export) +# define DECLSPEC __declspec(export) # endif # elif defined(__WIN32__) || defined(__WINRT__) # ifdef __BORLANDC__ # ifdef BUILD_SDL # define DECLSPEC # else -# define DECLSPEC __declspec(dllimport) +# define DECLSPEC __declspec(dllimport) # endif # else -# define DECLSPEC __declspec(dllexport) +# define DECLSPEC __declspec(dllexport) # endif # else # if defined(__GNUC__) && __GNUC__ >= 4 -# define DECLSPEC __attribute__ ((visibility("default"))) +# define DECLSPEC __attribute__ ((visibility("default"))) # else # define DECLSPEC # endif @@ -106,7 +106,7 @@ defined(__WATCOMC__) || defined(__LCC__) || \ defined(__DECC) #ifndef __inline__ -#define __inline__ __inline +#define __inline__ __inline #endif #define SDL_INLINE_OKAY #else diff --git a/include/close_code.h b/include/close_code.h index 410060370..4901482d5 100644 --- a/include/close_code.h +++ b/include/close_code.h @@ -21,7 +21,7 @@ /** * \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 */ diff --git a/include/doxyfile b/include/doxyfile index 3da0d56e8..495dbc19b 100644 --- a/include/doxyfile +++ b/include/doxyfile @@ -862,14 +862,14 @@ GENERATE_DOCSET = NO # documentation sets from a single provider (such as a company or product suite) # can be grouped. -DOCSET_FEEDNAME = "SDL 1.2 Doxygen" +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.sdl12 +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 @@ -883,7 +883,7 @@ GENERATE_HTMLHELP = NO # can add a path in front of the file if the result should not be # written to the html output directory. -CHM_FILE = ./sdl12.chm +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 diff --git a/sdl2.m4 b/sdl2.m4 index 93bc4b0f1..a03b2d270 100644 --- a/sdl2.m4 +++ b/sdl2.m4 @@ -21,7 +21,7 @@ AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL 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], ,0.9.0,$1) + 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], @@ -31,42 +31,42 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run 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${SDL_CONFIG+set} != xset ; then - SDL_CONFIG=$sdl_exec_prefix/bin/sdl2-config + 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${SDL_CONFIG+set} != xset ; then - SDL_CONFIG=$sdl_prefix/bin/sdl2-config + 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="" - SDL_CONFIG="pkg-config sdl2" + 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(SDL_CONFIG, sdl2-config, no, [$PATH]) + 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 "$SDL_CONFIG" = "no" ; then + if test "$SDL2_CONFIG" = "no" ; then no_sdl=yes else - SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs` + SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` - sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \ + sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \ + sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + 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" @@ -130,7 +130,7 @@ int main (int argc, char *argv[]) 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 SDL_CONFIG\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; @@ -152,10 +152,10 @@ int main (int argc, char *argv[]) if test "x$no_sdl" = x ; then ifelse([$2], , :, [$2]) else - if test "$SDL_CONFIG" = "no" ; then + 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 SDL_CONFIG environment variable to the" + 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 @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) [ 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: $SDL_CONFIG" ]) + echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" diff --git a/src/SDL.c b/src/SDL.c index 829da1e7b..d8c05fb5b 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -25,25 +25,29 @@ #include "SDL.h" #include "SDL_bits.h" #include "SDL_revision.h" -#include "SDL_fatal.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_TIMERS_DISABLED -extern void SDL_StartTicks(void); extern int SDL_TimerInit(void); extern void SDL_TimerQuit(void); +extern void SDL_InitTicks(void); #endif -#if defined(__WIN32__) +#if SDL_VIDEO_DRIVER_WINDOWS extern int SDL_HelperWindowCreate(void); extern int SDL_HelperWindowDestroy(void); #endif /* The initialized subsystems */ -static Uint32 ticks_started = 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 ]; @@ -89,18 +93,60 @@ SDL_PrivateShouldQuitSubsystem(Uint32 subsystem) { return SDL_SubsystemRefCount[subsystem_index] == 1 || SDL_bInMainQuit; } +void +SDL_SetMainReady(void) +{ + SDL_MainIsReady = SDL_TRUE; +} + int SDL_InitSubSystem(Uint32 flags) { -#if !SDL_TIMERS_DISABLED - if (!ticks_started) { - SDL_StartTicks(); - ticks_started = 1; + 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 + SDL_InitTicks(); +#endif + + 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 + } + /* Initialize the timer subsystem */ - if ((flags & SDL_INIT_TIMER) ){ + if ((flags & SDL_INIT_TIMER)){ #if !SDL_TIMERS_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_TIMER)) { if (SDL_TimerInit() < 0) { @@ -113,8 +159,8 @@ SDL_InitSubSystem(Uint32 flags) #endif } - /* Initialize the video/event subsystem */ - if ((flags & SDL_INIT_VIDEO) ){ + /* Initialize the video subsystem */ + if ((flags & SDL_INIT_VIDEO)){ #if !SDL_VIDEO_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_VIDEO)) { if (SDL_VideoInit(NULL) < 0) { @@ -128,7 +174,7 @@ SDL_InitSubSystem(Uint32 flags) } /* Initialize the audio subsystem */ - if ((flags & SDL_INIT_AUDIO) ){ + if ((flags & SDL_INIT_AUDIO)){ #if !SDL_AUDIO_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_AUDIO)) { if (SDL_AudioInit(NULL) < 0) { @@ -141,13 +187,8 @@ SDL_InitSubSystem(Uint32 flags) #endif } - if ((flags & SDL_INIT_GAMECONTROLLER)) { - // Game controller implies Joystick. - flags |= SDL_INIT_JOYSTICK; - } - /* Initialize the joystick subsystem */ - if ((flags & SDL_INIT_JOYSTICK) ){ + if ((flags & SDL_INIT_JOYSTICK)){ #if !SDL_JOYSTICK_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_JOYSTICK)) { if (SDL_JoystickInit() < 0) { @@ -160,7 +201,7 @@ SDL_InitSubSystem(Uint32 flags) #endif } - if ((flags & SDL_INIT_GAMECONTROLLER) ){ + if ((flags & SDL_INIT_GAMECONTROLLER)){ #if !SDL_JOYSTICK_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_GAMECONTROLLER)) { if (SDL_GameControllerInit() < 0) { @@ -174,7 +215,7 @@ SDL_InitSubSystem(Uint32 flags) } /* Initialize the haptic subsystem */ - if ((flags & SDL_INIT_HAPTIC) ){ + if ((flags & SDL_INIT_HAPTIC)){ #if !SDL_HAPTIC_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_HAPTIC)) { if (SDL_HapticInit() < 0) { @@ -193,30 +234,7 @@ SDL_InitSubSystem(Uint32 flags) int SDL_Init(Uint32 flags) { - if (SDL_AssertionsInit() < 0) { - return -1; - } - - /* Clear the error message */ - SDL_ClearError(); - -#if defined(__WIN32__) - if (SDL_HelperWindowCreate() < 0) { - return -1; - } -#endif - - /* Initialize the desired subsystems */ - if (SDL_InitSubSystem(flags) < 0) { - return (-1); - } - - /* Everything is initialized */ - if (!(flags & SDL_INIT_NOPARACHUTE)) { - SDL_InstallParachute(); - } - - return (0); + return SDL_InitSubSystem(flags); } void @@ -225,19 +243,22 @@ SDL_QuitSubSystem(Uint32 flags) /* Shut down requested initialized subsystems */ #if !SDL_JOYSTICK_DISABLED if ((flags & SDL_INIT_GAMECONTROLLER)) { - // Game controller implies Joystick. + /* 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_JoystickQuit(); + } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_JOYSTICK); } #endif @@ -245,8 +266,8 @@ SDL_QuitSubSystem(Uint32 flags) #if !SDL_HAPTIC_DISABLED if ((flags & SDL_INIT_HAPTIC)) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_HAPTIC)) { - SDL_HapticQuit(); - } + SDL_HapticQuit(); + } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_HAPTIC); } #endif @@ -254,17 +275,20 @@ SDL_QuitSubSystem(Uint32 flags) #if !SDL_AUDIO_DISABLED if ((flags & SDL_INIT_AUDIO)) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_AUDIO)) { - SDL_AudioQuit(); - } + SDL_AudioQuit(); + } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_AUDIO); } #endif #if !SDL_VIDEO_DISABLED if ((flags & SDL_INIT_VIDEO)) { + /* video implies events */ + flags |= SDL_INIT_EVENTS; + if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_VIDEO)) { - SDL_VideoQuit(); - } + SDL_VideoQuit(); + } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_VIDEO); } #endif @@ -272,11 +296,21 @@ SDL_QuitSubSystem(Uint32 flags) #if !SDL_TIMERS_DISABLED if ((flags & SDL_INIT_TIMER)) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_TIMER)) { - SDL_TimerQuit(); - } + SDL_TimerQuit(); + } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_TIMER); } #endif + +#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 } Uint32 @@ -310,14 +344,11 @@ SDL_Quit(void) SDL_bInMainQuit = SDL_TRUE; /* Quit all subsystems */ -#if defined(__WIN32__) +#if SDL_VIDEO_DRIVER_WINDOWS SDL_HelperWindowDestroy(); #endif SDL_QuitSubSystem(SDL_INIT_EVERYTHING); - /* Uninstall any parachute signal handlers */ - SDL_UninstallParachute(); - SDL_ClearHints(); SDL_AssertionsQuit(); SDL_LogResetPriorities(); @@ -359,9 +390,6 @@ SDL_GetPlatform() return "AIX"; #elif __ANDROID__ return "Android"; -#elif __HAIKU__ -/* Haiku must appear here before BeOS, since it also defines __BEOS__ */ - return "Haiku"; #elif __BEOS__ return "BeOS"; #elif __BSDI__ @@ -370,6 +398,8 @@ SDL_GetPlatform() return "Dreamcast"; #elif __FREEBSD__ return "FreeBSD"; +#elif __HAIKU__ + return "Haiku"; #elif __HPUX__ return "HP-UX"; #elif __IRIX__ @@ -399,7 +429,7 @@ SDL_GetPlatform() #elif __WIN32__ return "Windows"; #elif __IPHONEOS__ - return "iPhone OS"; + return "iOS"; #elif __PSP__ return "PlayStation Portable"; #else diff --git a/src/SDL_assert.c b/src/SDL_assert.c index c288b2a8d..73ebfe5fc 100644 --- a/src/SDL_assert.c +++ b/src/SDL_assert.c @@ -327,12 +327,6 @@ SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file, } -int SDL_AssertionsInit(void) -{ - /* this is a no-op at the moment. */ - return 0; -} - void SDL_AssertionsQuit(void) { SDL_GenerateAssertionReport(); diff --git a/src/SDL_assert_c.h b/src/SDL_assert_c.h index 12b1aa5e9..29802c04e 100644 --- a/src/SDL_assert_c.h +++ b/src/SDL_assert_c.h @@ -19,7 +19,6 @@ 3. This notice may not be removed or altered from any source distribution. */ -extern int SDL_AssertionsInit(void); 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 40388124b..98ef84ac6 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -31,12 +31,12 @@ #if SDL_THREADS_DISABLED /* 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 */ @@ -57,7 +57,7 @@ SDL_SetError(const char *fmt, ...) /* 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; diff --git a/src/SDL_error_c.h b/src/SDL_error_c.h index 1277b086d..2014cc1e7 100644 --- a/src/SDL_error_c.h +++ b/src/SDL_error_c.h @@ -27,8 +27,8 @@ #ifndef _SDL_error_c_h #define _SDL_error_c_h -#define ERR_MAX_STRLEN 128 -#define ERR_MAX_ARGS 5 +#define ERR_MAX_STRLEN 128 +#define ERR_MAX_ARGS 5 typedef struct SDL_error { diff --git a/src/SDL_fatal.c b/src/SDL_fatal.c deleted file mode 100644 index cf19e57e0..000000000 --- a/src/SDL_fatal.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2013 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 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 const 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 */ -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/SDL_hints.c b/src/SDL_hints.c index ed635c76d..b00e961cc 100644 --- a/src/SDL_hints.c +++ b/src/SDL_hints.c @@ -21,43 +21,35 @@ #include "SDL_config.h" #include "SDL_hints.h" -#include "SDL_hints_c.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 a linked list here. + 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_HintChangedCb callback; + SDL_HintWatch *callbacks; struct SDL_Hint *next; } SDL_Hint; static SDL_Hint *SDL_hints; -SDL_bool -SDL_RegisterHintChangedCb(const char *name, SDL_HintChangedCb hintCb) -{ - SDL_Hint *hint; - - for (hint = SDL_hints; hint; hint = hint->next) { - if (SDL_strcmp(name, hint->name) == 0) { - hint->callback = hintCb; - return SDL_TRUE; - } - } - - return SDL_FALSE; -} - 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; @@ -73,12 +65,21 @@ SDL_SetHintWithPriority(const char *name, const char *value, if (priority < hint->priority) { return SDL_FALSE; } - if (SDL_strcmp(hint->value, value) != 0) { - if (hint->callback != NULL) { - (*hint->callback)(name, hint->value, value); + 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; } - SDL_free(hint->value); - hint->value = SDL_strdup(value); } hint->priority = priority; return SDL_TRUE; @@ -91,9 +92,9 @@ SDL_SetHintWithPriority(const char *name, const char *value, return SDL_FALSE; } hint->name = SDL_strdup(name); - hint->value = SDL_strdup(value); + hint->value = value ? SDL_strdup(value) : NULL; hint->priority = priority; - hint->callback = NULL; + hint->callbacks = NULL; hint->next = SDL_hints; SDL_hints = hint; return SDL_TRUE; @@ -123,16 +124,100 @@ SDL_GetHint(const char *name) 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); - SDL_free(hint->value); + 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); } } diff --git a/src/SDL_hints_c.h b/src/SDL_hints_c.h deleted file mode 100644 index 74830c30c..000000000 --- a/src/SDL_hints_c.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2013 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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_hints_c_h -#define _SDL_hints_c_h - -/** - * \brief A callback function that is optionally called when a hint changes - */ -typedef void (*SDL_HintChangedCb)(const char *name, const char *oldValue, const char *newValue); - -extern SDL_bool SDL_RegisterHintChangedCb(const char *name, SDL_HintChangedCb hintCb); - -#endif /* _SDL_hints_c_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/SDL_log.c b/src/SDL_log.c index ad7b722ee..a19a2c425 100644 --- a/src/SDL_log.c +++ b/src/SDL_log.c @@ -39,6 +39,9 @@ #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; @@ -138,7 +141,7 @@ SDL_LogGetPriority(int category) } if (category == SDL_LOG_CATEGORY_TEST) { - return SDL_test_priority; + return SDL_test_priority; } else if (category == SDL_LOG_CATEGORY_APPLICATION) { return SDL_application_priority; } else if (category == SDL_LOG_CATEGORY_ASSERT) { @@ -263,6 +266,7 @@ 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) { @@ -283,27 +287,91 @@ SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list 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__) || defined(__WINRT__) /* 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; - length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1; + /* 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", SDL_priority_prefixes[priority], message); + 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); } @@ -314,7 +382,9 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, SDL_snprintf(tag, SDL_arraysize(tag), "SDL/%s", GetCategoryPrefix(category)); __android_log_write(SDL_android_priority[priority], tag, message); } -#elif defined(__APPLE__) +#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; @@ -328,19 +398,12 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, } } #elif defined(__PSP__) -//Simple Log System for PSP - { - unsigned int length; - char* output; - FILE* pFile; - length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1; - output = SDL_stack_alloc(char, length); - SDL_snprintf(output, length, "%s: %s", SDL_priority_prefixes[priority], message); - pFile = fopen ("SDL_Log.txt", "a"); - fwrite (output, strlen (output), 1, pFile); - SDL_stack_free(output); - fclose (pFile); - } + { + 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); diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c index 6cf2384a5..c747b12aa 100644 --- a/src/atomic/SDL_atomic.c +++ b/src/atomic/SDL_atomic.c @@ -29,8 +29,8 @@ */ #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 @@ -40,7 +40,7 @@ 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. + 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 @@ -101,4 +101,18 @@ SDL_AtomicCASPtr(void **a, void *oldval, void *newval) 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 index b50565974..f90528c35 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -76,11 +76,11 @@ SDL_AtomicTryLock(SDL_SpinLock *lock) return (result == 0); #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) - int result; - __asm__ __volatile__( + int result; + __asm__ __volatile__( "lock ; xchgl %0, (%1)\n" : "=r" (result) : "r" (lock), "0" (1) : "cc", "memory"); - return (result == 0); + return (result == 0); #elif defined(__MACOSX__) || defined(__IPHONEOS__) /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */ @@ -114,10 +114,10 @@ SDL_AtomicUnlock(SDL_SpinLock *lock) #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 diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index f6763f9b6..4d53e82b1 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -67,6 +67,7 @@ extern AudioBootStrap NDSAUD_bootstrap; extern AudioBootStrap FUSIONSOUND_bootstrap; extern AudioBootStrap ANDROIDAUD_bootstrap; extern AudioBootStrap PSPAUD_bootstrap; +extern AudioBootStrap SNDIO_bootstrap; /* Available audio drivers */ static const AudioBootStrap *const bootstrap[] = { @@ -76,6 +77,9 @@ static const AudioBootStrap *const bootstrap[] = { #if SDL_AUDIO_DRIVER_ALSA &ALSA_bootstrap, #endif +#if SDL_AUDIO_DRIVER_SNDIO + &SNDIO_bootstrap, +#endif #if SDL_AUDIO_DRIVER_BSD &BSD_AUDIO_bootstrap, #endif @@ -356,9 +360,7 @@ SDL_RunAudio(void *devicep) device->convert.len_mult; } #endif - - /* stream_len = device->convert.len; */ - stream_len = device->spec.size; + stream_len = device->convert.len; } else { stream_len = device->spec.size; } @@ -457,15 +459,11 @@ SDL_RunAudio(void *devicep) } } 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) { - if (device->paused) { - SDL_Delay(delay); - continue; - } - /* Fill the current buffer with sound */ if (device->convert.needed) { if (device->convert.buf) { @@ -481,7 +479,11 @@ SDL_RunAudio(void *devicep) } SDL_LockMutex(device->mixer_lock); - (*fill) (udata, stream, stream_len); + 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 */ @@ -954,12 +956,6 @@ open_audio_device(const char *devname, int iscapture, return 0; } - /* If the audio driver changes the buffer size, accept it */ - if (device->spec.samples != obtained->samples) { - obtained->samples = device->spec.samples; - SDL_CalculateAudioSpec(obtained); - } - /* See if we need to do any conversion */ build_cvt = SDL_FALSE; if (obtained->freq != device->spec.freq) { @@ -983,6 +979,16 @@ open_audio_device(const char *devname, int iscapture, 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, @@ -994,7 +1000,7 @@ open_audio_device(const char *devname, int iscapture, return 0; } if (device->convert.needed) { - device->convert.len = (int) (((double) obtained->size) / + device->convert.len = (int) (((double) device->spec.size) / device->convert.len_ratio); device->convert.buf = @@ -1110,7 +1116,9 @@ 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); } } @@ -1173,8 +1181,15 @@ void SDL_AudioQuit(void) { SDL_AudioDeviceID i; + + if (!current_audio.name) { /* not initialized?! */ + return; + } + for (i = 0; i < SDL_arraysize(open_devices); i++) { - SDL_CloseAudioDevice(i); + if (open_devices[i] != NULL) { + SDL_CloseAudioDevice(i+1); + } } /* Free the driver data */ diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 2d067e779..fc23b5d58 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -293,10 +293,9 @@ SDL_ConvertStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format) 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) { \ - const type val = *src; \ src -= 1; \ dst -= 2; \ - dst[0] = dst[1] = val; \ + dst[0] = dst[1] = *src; \ } \ } @@ -972,7 +971,7 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt, 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"); diff --git a/src/audio/SDL_audiodev.c b/src/audio/SDL_audiodev.c index 048a8a54e..91b60c376 100644 --- a/src/audio/SDL_audiodev.c +++ b/src/audio/SDL_audiodev.c @@ -40,10 +40,10 @@ #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 static inline void diff --git a/src/audio/SDL_audiomem.h b/src/audio/SDL_audiomem.h index 558ea4985..8c027c3a5 100644 --- a/src/audio/SDL_audiomem.h +++ b/src/audio/SDL_audiomem.h @@ -20,6 +20,6 @@ */ #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_mixer.c b/src/audio/SDL_mixer.c index b45102daa..37907596f 100644 --- a/src/audio/SDL_mixer.c +++ b/src/audio/SDL_mixer.c @@ -82,8 +82,8 @@ static const Uint8 mix8[] = { }; /* 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 diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index 13c82045e..83919c6e4 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -28,7 +28,7 @@ /* The SDL audio driver */ typedef struct SDL_AudioDevice SDL_AudioDevice; -#define _THIS SDL_AudioDevice *_this +#define _THIS SDL_AudioDevice *_this /* Used by audio targets during DetectDevices() */ typedef void (*SDL_AddAudioDevice)(const char *name); diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index b1bd0538c..18fdcacd3 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -273,6 +273,11 @@ IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state, Uint8 nybble) 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) @@ -287,11 +292,6 @@ IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state, Uint8 nybble) /* 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) { diff --git a/src/audio/SDL_wave.h b/src/audio/SDL_wave.h index d66e684d2..d82399cb8 100644 --- a/src/audio/SDL_wave.h +++ b/src/audio/SDL_wave.h @@ -25,26 +25,26 @@ /*******************************************/ /* 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 IEEE_FLOAT_CODE 0x0003 -#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 { /* Not saved in the chunk we read: - Uint32 FMTchunk; - Uint32 fmtlen; + Uint32 FMTchunk; + Uint32 fmtlen; */ Uint16 encoding; Uint16 channels; /* 1 = mono, 2 = stereo */ @@ -61,4 +61,5 @@ typedef struct Chunk 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 9b5e75624..13cc77bf6 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -155,7 +155,7 @@ static void UnloadALSALibrary(void) { if (alsa_handle != NULL) { - SDL_UnloadObject(alsa_handle); + SDL_UnloadObject(alsa_handle); alsa_handle = NULL; } } @@ -643,7 +643,7 @@ ALSA_OpenDevice(_THIS, const char *devname, int iscapture) ALSA_CloseDevice(this); return SDL_OutOfMemory(); } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen); /* Switch to blocking mode for playback */ ALSA_snd_pcm_nonblock(pcm_handle, 0); diff --git a/src/audio/alsa/SDL_alsa_audio.h b/src/audio/alsa/SDL_alsa_audio.h index 50acd5a33..31c653403 100644 --- a/src/audio/alsa/SDL_alsa_audio.h +++ b/src/audio/alsa/SDL_alsa_audio.h @@ -20,15 +20,15 @@ */ #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 audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -40,6 +40,6 @@ struct SDL_PrivateAudioData int mixlen; }; -#endif /* _ALSA_PCM_audio_h */ +#endif /* _SDL_ALSA_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 index f82854385..94e27f32f 100644 --- a/src/audio/android/SDL_androidaudio.c +++ b/src/audio/android/SDL_androidaudio.c @@ -38,59 +38,52 @@ static int AndroidAUD_OpenDevice(_THIS, const char *devname, int iscapture) { SDL_AudioFormat test_format; - int valid_datatype = 0; - + if (iscapture) { - //TODO: implement capture - return SDL_SetError("Capture not supported on Android"); + /* 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!"); + return SDL_SetError("Only one audio device at a time please!"); } audioDevice = this; - this->hidden = SDL_malloc(sizeof(*(this->hidden))); - if (!this->hidden) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - test_format = SDL_FirstAudioFormat(this->spec.format); - while (test_format != 0) { // no "UNKNOWN" constant + 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!"); + /* Didn't find a compatible format :( */ + return SDL_SetError("No compatible audio format!"); } if (this->spec.channels > 1) { - this->spec.channels = 2; + this->spec.channels = 2; } else { - this->spec.channels = 1; + this->spec.channels = 1; } if (this->spec.freq < 8000) { - this->spec.freq = 8000; + this->spec.freq = 8000; } if (this->spec.freq > 48000) { - 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 + /* 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!"); + /* Init failed? */ + return SDL_SetError("Java-side initialization failed!"); } return 0; @@ -111,14 +104,13 @@ AndroidAUD_GetDeviceBuf(_THIS) static void AndroidAUD_CloseDevice(_THIS) { - if (this->hidden != NULL) { - SDL_free(this->hidden); - this->hidden = NULL; - } - Android_JNI_CloseAudioDevice(); + /* 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; + audioDevice = NULL; } } @@ -132,8 +124,7 @@ AndroidAUD_Init(SDL_AudioDriverImpl * impl) impl->CloseDevice = AndroidAUD_CloseDevice; /* and the capabilities */ - impl->ProvidesOwnCallbackThread = 1; - impl->HasCaptureSupport = 0; //TODO + impl->HasCaptureSupport = 0; /* TODO */ impl->OnlyHasDefaultOutputDevice = 1; impl->OnlyHasDefaultInputDevice = 1; @@ -144,13 +135,7 @@ AudioBootStrap ANDROIDAUD_bootstrap = { "android", "SDL Android audio driver", AndroidAUD_Init, 0 }; -/* Called by the Java code to start the audio processing on a thread */ -void -Android_RunAudioThread() -{ - SDL_RunAudio(audioDevice); -} - #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 index fbadcfc71..c02ad1a7a 100644 --- a/src/audio/android/SDL_androidaudio.h +++ b/src/audio/android/SDL_androidaudio.h @@ -26,12 +26,14 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#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.h b/src/audio/arts/SDL_artsaudio.h index 8b3f290b1..1387cc5c0 100644 --- a/src/audio/arts/SDL_artsaudio.h +++ b/src/audio/arts/SDL_artsaudio.h @@ -28,7 +28,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -46,7 +46,7 @@ struct SDL_PrivateAudioData 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 */ #endif /* _SDL_artscaudio_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/baudio/SDL_beaudio.h b/src/audio/baudio/SDL_beaudio.h index 9ce5af235..61f9dec83 100644 --- a/src/audio/baudio/SDL_beaudio.h +++ b/src/audio/baudio/SDL_beaudio.h @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *_this +#define _THIS SDL_AudioDevice *_this struct SDL_PrivateAudioData { diff --git a/src/audio/bsd/SDL_bsdaudio.h b/src/audio/bsd/SDL_bsdaudio.h index b06aca9c9..b64be31b2 100644 --- a/src/audio/bsd/SDL_bsdaudio.h +++ b/src/audio/bsd/SDL_bsdaudio.h @@ -25,7 +25,7 @@ #include "../SDL_sysaudio.h" -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -44,7 +44,7 @@ struct SDL_PrivateAudioData float next_frame; }; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ #endif /* _SDL_bsdaudio_h */ diff --git a/src/audio/coreaudio/SDL_coreaudio.c b/src/audio/coreaudio/SDL_coreaudio.c index 8f83d0b39..a35135a2f 100644 --- a/src/audio/coreaudio/SDL_coreaudio.c +++ b/src/audio/coreaudio/SDL_coreaudio.c @@ -308,8 +308,8 @@ inputCallback(void *inRefCon, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList * ioData) { - //err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); - // !!! FIXME: write me! + /* err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); */ + /* !!! FIXME: write me! */ return noErr; } @@ -380,7 +380,7 @@ prepare_audiounit(_THIS, const char *devname, int iscapture, return 0; } #endif - + SDL_zero(desc); desc.componentType = kAudioUnitType_Output; desc.componentManufacturer = kAudioUnitManufacturer_Apple; diff --git a/src/audio/coreaudio/SDL_coreaudio.h b/src/audio/coreaudio/SDL_coreaudio.h index 31057557e..2f0db5ba8 100644 --- a/src/audio/coreaudio/SDL_coreaudio.h +++ b/src/audio/coreaudio/SDL_coreaudio.h @@ -32,9 +32,6 @@ #if MACOSX_COREAUDIO #include #include -#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 -#include -#endif #else #include #endif @@ -42,7 +39,7 @@ #include /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { diff --git a/src/audio/directsound/SDL_directsound.c b/src/audio/directsound/SDL_directsound.c index e320056b5..686d46615 100644 --- a/src/audio/directsound/SDL_directsound.c +++ b/src/audio/directsound/SDL_directsound.c @@ -30,6 +30,10 @@ #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); @@ -342,7 +346,7 @@ DSOUND_CloseDevice(_THIS) number of audio chunks available in the created buffer. */ static int -CreateSecondary(_THIS, HWND focus, WAVEFORMATEX * wavefmt) +CreateSecondary(_THIS, HWND focus) { LPDIRECTSOUND sndObj = this->hidden->sound; LPDIRECTSOUNDBUFFER *sndbuf = &this->hidden->mixbuf; @@ -352,6 +356,24 @@ CreateSecondary(_THIS, HWND focus, WAVEFORMATEX * wavefmt) 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) { @@ -367,7 +389,7 @@ CreateSecondary(_THIS, HWND focus, WAVEFORMATEX * wavefmt) } /* Try to create the secondary buffer */ - SDL_memset(&format, 0, sizeof(format)); + SDL_zero(format); format.dwSize = sizeof(format); format.dwFlags = DSBCAPS_GETCURRENTPOSITION2; if (!focus) { @@ -382,12 +404,12 @@ CreateSecondary(_THIS, HWND focus, WAVEFORMATEX * wavefmt) DSBSIZE_MIN / numchunks, DSBSIZE_MAX / numchunks); } format.dwReserved = 0; - format.lpwfxFormat = wavefmt; + format.lpwfxFormat = &wfmt; result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL); if (result != DS_OK) { return SetDSerror("DirectSound CreateSoundBuffer", result); } - IDirectSoundBuffer_SetFormat(*sndbuf, wavefmt); + IDirectSoundBuffer_SetFormat(*sndbuf, &wfmt); /* Silence the initial audio buffer */ result = IDirectSoundBuffer_Lock(*sndbuf, 0, format.dwBufferBytes, @@ -433,8 +455,8 @@ static int DSOUND_OpenDevice(_THIS, const char *devname, int iscapture) { HRESULT result; - WAVEFORMATEX waveformat; - int valid_format = 0; + 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; @@ -461,36 +483,6 @@ DSOUND_OpenDevice(_THIS, const char *devname, int iscapture) } SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - while ((!valid_format) && (test_format)) { - switch (test_format) { - case AUDIO_U8: - case AUDIO_S16: - case AUDIO_S32: - this->spec.format = test_format; - valid_format = 1; - break; - } - test_format = SDL_NextAudioFormat(); - } - - if (!valid_format) { - DSOUND_CloseDevice(this); - return SDL_SetError("DirectSound: Unsupported audio format"); - } - - SDL_memset(&waveformat, 0, sizeof(waveformat)); - 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; - - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(&this->spec); - /* Open the audio device */ result = pDirectSoundCreate8(guid, &this->hidden->sound, NULL); if (result != DS_OK) { @@ -498,11 +490,29 @@ DSOUND_OpenDevice(_THIS, const char *devname, int iscapture) return SetDSerror("DirectSoundCreate", result); } - /* Create the audio buffer to which we write */ - this->hidden->num_buffers = CreateSecondary(this, NULL, &waveformat); - if (this->hidden->num_buffers < 0) { + 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); - return -1; + 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() */ diff --git a/src/audio/directsound/SDL_directsound.h b/src/audio/directsound/SDL_directsound.h index 37a6ee133..758299f14 100644 --- a/src/audio/directsound/SDL_directsound.h +++ b/src/audio/directsound/SDL_directsound.h @@ -28,7 +28,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this /* The DirectSound objects */ struct SDL_PrivateAudioData diff --git a/src/audio/directsound/directx.h b/src/audio/directsound/directx.h index 8ddfa00cb..963d2b88e 100644 --- a/src/audio/directsound/directx.h +++ b/src/audio/directsound/directx.h @@ -19,47 +19,47 @@ /* 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)))) + ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code)))) #endif #ifndef S_OK -#define S_OK (HRESULT)0x00000000L +#define S_OK (HRESULT)0x00000000L #endif #ifndef SUCCEEDED -#define SUCCEEDED(x) ((HRESULT)(x) >= 0) +#define SUCCEEDED(x) ((HRESULT)(x) >= 0) #endif #ifndef FAILED -#define FAILED(x) ((HRESULT)(x)<0) +#define FAILED(x) ((HRESULT)(x)<0) #endif #ifndef E_FAIL -#define E_FAIL (HRESULT)0x80000008L +#define E_FAIL (HRESULT)0x80000008L #endif #ifndef E_NOINTERFACE -#define E_NOINTERFACE (HRESULT)0x80004002L +#define E_NOINTERFACE (HRESULT)0x80004002L #endif #ifndef E_OUTOFMEMORY -#define E_OUTOFMEMORY (HRESULT)0x8007000EL +#define E_OUTOFMEMORY (HRESULT)0x8007000EL #endif #ifndef E_INVALIDARG -#define E_INVALIDARG (HRESULT)0x80070057L +#define E_INVALIDARG (HRESULT)0x80070057L #endif #ifndef E_NOTIMPL -#define E_NOTIMPL (HRESULT)0x80004001L +#define E_NOTIMPL (HRESULT)0x80004001L #endif #ifndef REGDB_E_CLASSNOTREG -#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L +#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L #endif /* Severity codes */ #ifndef SEVERITY_ERROR -#define SEVERITY_ERROR 1 +#define SEVERITY_ERROR 1 #endif /* Error facility codes */ #ifndef FACILITY_WIN32 -#define FACILITY_WIN32 7 +#define FACILITY_WIN32 7 #endif #ifndef FIELD_OFFSET diff --git a/src/audio/disk/SDL_diskaudio.c b/src/audio/disk/SDL_diskaudio.c index 89687ed18..2286ba095 100644 --- a/src/audio/disk/SDL_diskaudio.c +++ b/src/audio/disk/SDL_diskaudio.c @@ -114,6 +114,10 @@ DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture) } 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) { @@ -129,10 +133,6 @@ DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture) } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - this->hidden->mixlen = this->spec.size; - this->hidden->write_delay = - (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY; - #if HAVE_STDIO_H fprintf(stderr, "WARNING: You are using the SDL disk writer audio driver!\n" diff --git a/src/audio/disk/SDL_diskaudio.h b/src/audio/disk/SDL_diskaudio.h index 3869bd145..7e5b48406 100644 --- a/src/audio/disk/SDL_diskaudio.h +++ b/src/audio/disk/SDL_diskaudio.h @@ -27,7 +27,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { diff --git a/src/audio/dsp/SDL_dspaudio.c b/src/audio/dsp/SDL_dspaudio.c index f868e874a..c62a22f8a 100644 --- a/src/audio/dsp/SDL_dspaudio.c +++ b/src/audio/dsp/SDL_dspaudio.c @@ -161,7 +161,7 @@ DSP_OpenDevice(_THIS, const char *devname, int iscapture) 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: diff --git a/src/audio/dsp/SDL_dspaudio.h b/src/audio/dsp/SDL_dspaudio.h index 9f7df71c5..62ed45f18 100644 --- a/src/audio/dsp/SDL_dspaudio.h +++ b/src/audio/dsp/SDL_dspaudio.h @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -37,7 +37,7 @@ struct SDL_PrivateAudioData Uint8 *mixbuf; int mixlen; }; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per 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.h b/src/audio/dummy/SDL_dummyaudio.h index 22a4cd242..c0015a54d 100644 --- a/src/audio/dummy/SDL_dummyaudio.h +++ b/src/audio/dummy/SDL_dummyaudio.h @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c index cdc12120f..92716f39b 100644 --- a/src/audio/esd/SDL_esdaudio.c +++ b/src/audio/esd/SDL_esdaudio.c @@ -40,7 +40,7 @@ #include "SDL_name.h" #include "SDL_loadso.h" #else -#define SDL_NAME(X) X +#define SDL_NAME(X) X #endif #ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC @@ -123,7 +123,7 @@ ESD_WaitDevice(_THIS) /* Check to see if the thread-parent process is still alive */ { static int cnt = 0; - /* Note that this only works with thread implementations + /* Note that this only works with thread implementations that use a different process id for each thread. */ /* Check every 10 loops */ diff --git a/src/audio/esd/SDL_esdaudio.h b/src/audio/esd/SDL_esdaudio.h index ab0e25217..26bea9cf0 100644 --- a/src/audio/esd/SDL_esdaudio.h +++ b/src/audio/esd/SDL_esdaudio.h @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -44,7 +44,7 @@ struct SDL_PrivateAudioData 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 */ #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 index bc279fec6..2e468d5c6 100644 --- a/src/audio/fusionsound/SDL_fsaudio.c +++ b/src/audio/fusionsound/SDL_fsaudio.c @@ -37,13 +37,13 @@ #include -//#define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so" +/* #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 +#define SDL_NAME(X) X #endif #if (FUSIONSOUND_MAJOR_VERSION == 1) && (FUSIONSOUND_MINOR_VERSION < 1) @@ -51,7 +51,7 @@ typedef DFBResult DirectResult; #endif /* Buffers to use - more than 2 gives a lot of latency */ -#define FUSION_BUFFERS (2) +#define FUSION_BUFFERS (2) #ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC diff --git a/src/audio/fusionsound/SDL_fsaudio.h b/src/audio/fusionsound/SDL_fsaudio.h index 0c313d666..7f2277501 100644 --- a/src/audio/fusionsound/SDL_fsaudio.h +++ b/src/audio/fusionsound/SDL_fsaudio.h @@ -28,7 +28,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { diff --git a/src/audio/nas/SDL_nasaudio.h b/src/audio/nas/SDL_nasaudio.h index 65739cdf7..85bd761dd 100644 --- a/src/audio/nas/SDL_nasaudio.h +++ b/src/audio/nas/SDL_nasaudio.h @@ -33,7 +33,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { diff --git a/src/audio/paudio/SDL_paudio.c b/src/audio/paudio/SDL_paudio.c index 3966d1e7a..5a18b45e5 100644 --- a/src/audio/paudio/SDL_paudio.c +++ b/src/audio/paudio/SDL_paudio.c @@ -48,13 +48,13 @@ #include /* 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 */ #ifndef _PATH_DEV_DSP -#define _PATH_DEV_DSP "/dev/%caud%c/%c" +#define _PATH_DEV_DSP "/dev/%caud%c/%c" #endif static char devsettings[][3] = { diff --git a/src/audio/paudio/SDL_paudio.h b/src/audio/paudio/SDL_paudio.h index 0aa0e2be9..7be1ed651 100644 --- a/src/audio/paudio/SDL_paudio.h +++ b/src/audio/paudio/SDL_paudio.h @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -41,7 +41,7 @@ struct SDL_PrivateAudioData 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 */ #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 index fc03a8754..4b5534a3c 100644 --- a/src/audio/psp/SDL_pspaudio.c +++ b/src/audio/psp/SDL_pspaudio.c @@ -42,28 +42,28 @@ static int PSPAUD_OpenDevice(_THIS, const char *devname, int iscapture) { - int format, mixlen, i; + 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"); - } + 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; + /* 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 + /* Update the fragment size as size in bytes. */ +// SDL_CalculateAudioSpec(this->spec); MOD switch (this->spec.format) { case AUDIO_U8: this->spec.silence = 0x80; @@ -75,86 +75,86 @@ PSPAUD_OpenDevice(_THIS, const char *devname, int iscapture) 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"); - } + /* 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"); - } + /* 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]; - } + 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; + this->hidden->next_buffer = 0; + return 0; } static void PSPAUD_PlayDevice(_THIS) { - Uint8 *mixbuf = this->hidden->mixbufs[this->hidden->next_buffer]; + 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); - } + 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->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. */ + /* 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]; + 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->channel >= 0) { + sceAudioChRelease(this->hidden->channel); + this->hidden->channel = -1; + } - if (this->hidden->rawbuf != NULL) { - free(this->hidden->rawbuf); - this->hidden->rawbuf = NULL; - } + 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); - } + /* 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); + } } @@ -162,17 +162,17 @@ static int PSPAUD_Init(SDL_AudioDriverImpl * impl) { - // Set the function pointers + // Set the function pointers impl->OpenDevice = PSPAUD_OpenDevice; impl->PlayDevice = PSPAUD_PlayDevice; impl->WaitDevice = PSPAUD_WaitDevice; - impl->GetDeviceBuf = PSPAUD_GetDeviceBuf; + impl->GetDeviceBuf = PSPAUD_GetDeviceBuf; impl->WaitDone = PSPAUD_WaitDevice; impl->CloseDevice = PSPAUD_CloseDevice; impl->ThreadInit = PSPAUD_ThreadInit; - + //PSP audio device - impl->OnlyHasDefaultOutputDevice = 1; + impl->OnlyHasDefaultOutputDevice = 1; /* impl->HasCaptureSupport = 1; diff --git a/src/audio/psp/SDL_pspaudio.h b/src/audio/psp/SDL_pspaudio.h index 22cf2d327..139476c6b 100644 --- a/src/audio/psp/SDL_pspaudio.h +++ b/src/audio/psp/SDL_pspaudio.h @@ -25,19 +25,19 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this +#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; + /* 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 */ diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c index 12021e6de..46269d177 100644 --- a/src/audio/pulseaudio/SDL_pulseaudio.c +++ b/src/audio/pulseaudio/SDL_pulseaudio.c @@ -49,7 +49,7 @@ #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) { +static __inline__ int PA_CONTEXT_IS_GOOD(pa_context_state_t x) { return x == PA_CONTEXT_CONNECTING || x == PA_CONTEXT_AUTHORIZING || @@ -57,7 +57,7 @@ static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) { 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) { +static __inline__ int PA_STREAM_IS_GOOD(pa_stream_state_t x) { return x == PA_STREAM_CREATING || x == PA_STREAM_READY; @@ -65,6 +65,7 @@ static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) { #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 *); @@ -131,7 +132,7 @@ static void UnloadPulseAudioLibrary(void) { if (pulseaudio_handle != NULL) { - SDL_UnloadObject(pulseaudio_handle); + SDL_UnloadObject(pulseaudio_handle); pulseaudio_handle = NULL; } } @@ -177,6 +178,7 @@ LoadPulseAudioLibrary(void) 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); @@ -322,6 +324,28 @@ PULSEAUDIO_CloseDevice(_THIS) } +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) { @@ -360,6 +384,18 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) 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; @@ -420,7 +456,7 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) } h->mainloop_api = PULSEAUDIO_pa_mainloop_get_api(h->mainloop); - h->context = PULSEAUDIO_pa_context_new(h->mainloop_api, NULL); + h->context = PULSEAUDIO_pa_context_new(h->mainloop_api, getAppName()); if (!h->context) { PULSEAUDIO_CloseDevice(this); return SDL_SetError("pa_context_new() failed"); diff --git a/src/audio/sndio/SDL_sndioaudio.c b/src/audio/sndio/SDL_sndioaudio.c new file mode 100644 index 000000000..16d0ec356 --- /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/test/test-automation/src/libSDLtest/logger_helpers.h b/src/audio/sndio/SDL_sndioaudio.h similarity index 62% rename from test/test-automation/src/libSDLtest/logger_helpers.h rename to src/audio/sndio/SDL_sndioaudio.h index 2528d5297..94e1542e4 100644 --- a/test/test-automation/src/libSDLtest/logger_helpers.h +++ b/src/audio/sndio/SDL_sndioaudio.h @@ -1,5 +1,6 @@ /* - Copyright (C) 2011 Markus Kauppila + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -17,24 +18,28 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ +#include "SDL_config.h" -#ifndef _LOGGER_HELPERS_G -#define _LOGGER_HELPERS_G +#ifndef _SDL_sndioaudio_h +#define _SDL_sndioaudio_h -#include +#include -char *IntToString(const int integer); +#include "../SDL_sysaudio.h" -char *IntToHexString(const Uint64 integer); +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this -char *DoubleToString(const double decimal); +struct SDL_PrivateAudioData +{ + /* The audio device handle */ + struct sio_hdl *dev; -char *TimestampToString(const time_t timestamp); + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; +}; -char *TimestampToStringWithFormat(const time_t timestamp, char *format); +#endif /* _SDL_sndioaudio_h */ -char *ToLowerCase(const char *string); - -int ValidateString(const char *string); - -#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/sun/SDL_sunaudio.c b/src/audio/sun/SDL_sunaudio.c index 37e175e10..950ba444c 100644 --- a/src/audio/sun/SDL_sunaudio.c +++ b/src/audio/sun/SDL_sunaudio.c @@ -47,7 +47,7 @@ /* Open the audio device for playback, and don't block if busy */ -#if defined(AUDIO_GETINFO) && !defined(AUDIO_GETBUFINFO) +#if defined(AUDIO_GETINFO) && !defined(AUDIO_GETBUFINFO) #define AUDIO_GETBUFINFO AUDIO_GETINFO #endif @@ -82,7 +82,7 @@ static void SUNAUDIO_WaitDevice(_THIS) { #ifdef AUDIO_GETBUFINFO -#define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */ +#define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */ audio_info_t info; Sint32 left; diff --git a/src/audio/sun/SDL_sunaudio.h b/src/audio/sun/SDL_sunaudio.h index 1f2c0b4f2..9b92266fb 100644 --- a/src/audio/sun/SDL_sunaudio.h +++ b/src/audio/sun/SDL_sunaudio.h @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { diff --git a/src/audio/winmm/SDL_winmm.c b/src/audio/winmm/SDL_winmm.c index f52a3afb1..9c8da7ae2 100644 --- a/src/audio/winmm/SDL_winmm.c +++ b/src/audio/winmm/SDL_winmm.c @@ -32,6 +32,10 @@ #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(); \ @@ -162,16 +166,6 @@ WINMM_CloseDevice(_THIS) this->hidden->audio_sem = 0; } - if (this->hidden->hin) { - waveInClose(this->hidden->hin); - this->hidden->hin = 0; - } - - if (this->hidden->hout) { - waveOutClose(this->hidden->hout); - this->hidden->hout = 0; - } - /* Clean up mixing buffers */ for (i = 0; i < NUM_BUFFERS; ++i) { if (this->hidden->wavebuf[i].dwUser != 0xFFFF) { @@ -188,11 +182,45 @@ WINMM_CloseDevice(_THIS) 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) { @@ -250,17 +278,28 @@ WINMM_OpenDevice(_THIS, const char *devname, int iscapture) 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)) { - valid_datatype = 1; - this->spec.format = test_format; switch (test_format) { case AUDIO_U8: case AUDIO_S16: case AUDIO_S32: - break; /* valid. */ + case AUDIO_F32: + this->spec.format = test_format; + if (PrepWaveFormat(this, devId, &waveformat, iscapture)) { + valid_datatype = 1; + } else { + test_format = SDL_NextAudioFormat(); + } + break; default: - valid_datatype = 0; test_format = SDL_NextAudioFormat(); break; } @@ -271,25 +310,6 @@ WINMM_OpenDevice(_THIS, const char *devname, int iscapture) return SDL_SetError("Unsupported audio format"); } - /* Set basic WAVE format parameters */ - SDL_memset(&waveformat, '\0', sizeof(waveformat)); - waveformat.wFormatTag = WAVE_FORMAT_PCM; - waveformat.wBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format); - - if (this->spec.channels > 2) - this->spec.channels = 2; /* !!! FIXME: is this right? */ - - waveformat.nChannels = this->spec.channels; - waveformat.nSamplesPerSec = this->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 (this->spec.samples < (this->spec.freq / 4)) - this->spec.samples = ((this->spec.freq / 4) + 3) & ~3; - /* Update the fragment size as size in bytes */ SDL_CalculateAudioSpec(&this->spec); diff --git a/src/audio/winmm/SDL_winmm.h b/src/audio/winmm/SDL_winmm.h index 8e67f2237..5a0574d1e 100644 --- a/src/audio/winmm/SDL_winmm.h +++ b/src/audio/winmm/SDL_winmm.h @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this #define NUM_BUFFERS 2 /* -- Don't lower this! */ diff --git a/src/audio/xaudio2/SDL_xaudio2.c b/src/audio/xaudio2/SDL_xaudio2.c index 1452090c9..19f7cdc5c 100644 --- a/src/audio/xaudio2/SDL_xaudio2.c +++ b/src/audio/xaudio2/SDL_xaudio2.c @@ -1,577 +1,583 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2013 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/* WinRT NOTICE: - - A number of changes were warranted to SDL's XAudio2 backend in order to - get it compiling for Windows RT. - - When compiling for WinRT, XAudio2.h requires that it be compiled in a C++ - file, and not a straight C file. Trying to compile it as C leads to lots - of errors, at least with MSVC 2012 and Windows SDK 8.0, as of Nov 22, 2012. - To address this specific issue, a few changes were made to SDL_xaudio2.c: - - 1. SDL_xaudio2.c is compiled as a C++ file in WinRT builds. Exported - symbols, namely XAUDIO2_bootstrap, uses 'extern "C"' to make sure the - rest of SDL can access it. Non-WinRT builds continue to compile - SDL_xaudio2.c as a C file. - 2. A macro redefines variables named 'this' to '_this', to prevent compiler - errors (C2355 in Visual C++) related to 'this' being a reserverd keyword. - This hack may need to be altered in the future, particularly if C++'s - 'this' keyword needs to be used (within SDL_xaudio2.c). At the time - WinRT support was initially added to SDL's XAudio2 backend, this - capability was not needed. - 3. The C-style macros to invoke XAudio2's COM-based methods were - rewritten to be C++-friendly. These are provided in the file, - SDL_xaudio2_winrthelpers.h. - 4. IXAudio2::CreateSourceVoice, when used in C++, requires its callbacks to - be specified via a C++ class. SDL's XAudio2 backend was written with - C-style callbacks. A class to bridge these two interfaces, - SDL_XAudio2VoiceCallback, was written to make XAudio2 happy. Its methods - just call SDL's existing, C-style callbacks. - 5. Multiple checks for the __cplusplus macro were made, in appropriate - places. - - - A few additional changes to SDL's XAudio2 backend were warranted by API - changes to Windows. Many, but not all of these are documented by Microsoft - at: - http://blogs.msdn.com/b/chuckw/archive/2012/04/02/xaudio2-and-windows-8-consumer-preview.aspx - - 1. Windows' thread synchronization function, CreateSemaphore, was removed - from Windows RT. SDL's semaphore API was substituted instead. - 2. The method calls, IXAudio2::GetDeviceCount and IXAudio2::GetDeviceDetails - were removed from the XAudio2 API. Microsoft is telling developers to - use APIs in Windows::Foundation instead. - For SDL, the missing methods were reimplemented using the APIs Microsoft - said to use. - 3. CoInitialize and CoUninitialize are not available in Windows RT. - These calls were removed, as COM will have been initialized earlier, - at least by the call to the WinRT app's main function - (aka 'int main(Platform::Array^)). (DLudwig: - This was my understanding of how WinRT: the 'main' function uses - a tag of [MTAThread], which should initialize COM. My understanding - of COM is somewhat limited, and I may be incorrect here.) - 4. IXAudio2::CreateMasteringVoice changed its integer-based 'DeviceIndex' - argument to a string-based one, 'szDeviceId'. In Windows RT, the - string-based argument will be used. -*/ - -#include "SDL_config.h" - -#if SDL_AUDIO_DRIVER_XAUDIO2 - -#ifdef __cplusplus -extern "C" { -#endif -#include "../../core/windows/SDL_windows.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" -#include "SDL_assert.h" -#ifdef __cplusplus -} -#endif - -#if defined(__WINRT__) -# define SDL_XAUDIO2_HAS_SDK 1 -#endif -#if defined(__WIN32__) -#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 - -#ifdef SDL_XAUDIO2_HAS_SDK - -#define INITGUID 1 -#include - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -#ifdef __cplusplus -#define this _this -#include "SDL_xaudio2_winrthelpers.h" -#endif - -struct SDL_PrivateAudioData -{ - IXAudio2 *ixa2; - IXAudio2SourceVoice *source; - IXAudio2MasteringVoice *mastering; - SDL_sem * semaphore; - Uint8 *mixbuf; - int mixlen; - Uint8 *nextbuf; -}; - - -static void -XAUDIO2_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) -{ - IXAudio2 *ixa2 = NULL; - UINT32 devcount = 0; - UINT32 i = 0; - void *ptr = NULL; - - if (iscapture) { - SDL_SetError("XAudio2: capture devices unsupported."); - return; - } else if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { - SDL_SetError("XAudio2: XAudio2Create() failed."); - 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 = WIN_StringToUTF8(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; - SDL_SemPost(this->hidden->semaphore); -} - -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) {} - -#if defined(__cplusplus) -class SDL_XAudio2VoiceCallback : public IXAudio2VoiceCallback -{ -public: - STDMETHOD_(void, OnBufferEnd)(void *pBufferContext) { - VoiceCBOnBufferEnd(pBufferContext); - } - STDMETHOD_(void, OnBufferStart)(void *pBufferContext) { - VoiceCBOnBufferStart(pBufferContext); - } - STDMETHOD_(void, OnLoopEnd)(void *pBufferContext) { - VoiceCBOnLoopEnd(pBufferContext); - } - STDMETHOD_(void, OnStreamEnd)() { - VoiceCBOnStreamEnd(); - } - STDMETHOD_(void, OnVoiceError)(void *pBufferContext, HRESULT Error) { - VoiceCBOnVoiceError(pBufferContext, Error); - } - STDMETHOD_(void, OnVoiceProcessingPassEnd)() { - VoiceCBOnVoiceProcessPassEnd(); - } - STDMETHOD_(void, OnVoiceProcessingPassStart)(UINT32 BytesRequired) { - VoiceCBOnVoiceProcessPassStart(BytesRequired); - } -}; -#endif - -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) { - SDL_SemWait(this->hidden->semaphore); - } -} - -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) { - SDL_SemWait(this->hidden->semaphore); - 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) { - SDL_DestroySemaphore(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; -#if defined(__WINRT__) - WCHAR devIdBuffer[256]; - LPCWSTR devId = 0; -#else - UINT32 devId = 0; /* 0 == system default device. */ -#endif - -#if defined(__cplusplus) - static SDL_XAudio2VoiceCallback callbacks; -#else - static IXAudio2VoiceCallbackVtbl callbacks_vtable = { - VoiceCBOnVoiceProcessPassStart, - VoiceCBOnVoiceProcessPassEnd, - VoiceCBOnStreamEnd, - VoiceCBOnBufferStart, - VoiceCBOnBufferEnd, - VoiceCBOnLoopEnd, - VoiceCBOnVoiceError - }; - - static IXAudio2VoiceCallback callbacks = { &callbacks_vtable }; -#endif // ! defined(__cplusplus) - -#if defined(__WINRT__) - SDL_zero(devIdBuffer); -#endif - - 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."); - } - /* - XAUDIO2_DEBUG_CONFIGURATION debugConfig; - debugConfig.TraceMask = XAUDIO2_LOG_ERRORS; //XAUDIO2_LOG_WARNINGS | XAUDIO2_LOG_DETAIL | XAUDIO2_LOG_FUNC_CALLS | XAUDIO2_LOG_TIMING | XAUDIO2_LOG_LOCKS | XAUDIO2_LOG_MEMORY | XAUDIO2_LOG_STREAMING; - debugConfig.BreakMask = XAUDIO2_LOG_ERRORS; //XAUDIO2_LOG_WARNINGS; - debugConfig.LogThreadID = TRUE; - debugConfig.LogFileline = TRUE; - debugConfig.LogFunctionName = TRUE; - debugConfig.LogTiming = TRUE; - ixa2->SetDebugConfiguration(&debugConfig); - */ - -#if ! defined(__WINRT__) || WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP - 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 = WIN_StringToUTF8(details.DisplayName); - if (str != NULL) { - const int match = (SDL_strcmp(str, devname) == 0); - SDL_free(str); - if (match) { -#if defined(__WINRT__) - wcsncpy_s(devIdBuffer, ARRAYSIZE(devIdBuffer), details.DeviceID, _TRUNCATE); - devId = (LPCWSTR) &devIdBuffer; -#else - devId = i; -#endif - break; - } - } - } - } - - if (i == devcount) { - IXAudio2_Release(ixa2); - return SDL_SetError("XAudio2: Requested device not found."); - } - } -#endif - - /* 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 = SDL_CreateSemaphore(1); - 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; - waveformat.cbSize = sizeof(waveformat); - -#ifdef __WINRT__ - // DLudwig: for now, make XAudio2 do sample rate conversion, just to - // get the loopwave test to work. - // - // TODO, WinRT: consider removing WinRT-specific source-voice creation code from SDL_xaudio2.c - result = IXAudio2_CreateSourceVoice(ixa2, &source, &waveformat, - 0, - 1.0f, &callbacks, NULL, NULL); -#else - result = IXAudio2_CreateSourceVoice(ixa2, &source, &waveformat, - XAUDIO2_VOICE_NOSRC | - XAUDIO2_VOICE_NOPITCH, - 1.0f, &callbacks, NULL, NULL); - -#endif - 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) -{ -#if defined(__WIN32__) - WIN_CoUninitialize(); -#endif -} - -#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 defined(__WIN32__) - // TODO, WinRT: Investigate using CoInitializeEx here - if (FAILED(WIN_CoInitialize())) { - SDL_SetError("XAudio2: CoInitialize() failed"); - return 0; - } -#endif - - if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { -#if defined(__WIN32__) - WIN_CoUninitialize(); -#endif - SDL_SetError("XAudio2: XAudio2Create() failed"); - 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 -} - -#if defined(__cplusplus) -extern "C" -#endif -AudioBootStrap XAUDIO2_bootstrap = { - "xaudio2", "XAudio2", XAUDIO2_Init, 0 -}; - -#endif /* SDL_AUDIO_DRIVER_XAUDIO2 */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* WinRT NOTICE: + + A number of changes were warranted to SDL's XAudio2 backend in order to + get it compiling for Windows RT. + + When compiling for WinRT, XAudio2.h requires that it be compiled in a C++ + file, and not a straight C file. Trying to compile it as C leads to lots + of errors, at least with MSVC 2012 and Windows SDK 8.0, as of Nov 22, 2012. + To address this specific issue, a few changes were made to SDL_xaudio2.c: + + 1. SDL_xaudio2.c is compiled as a C++ file in WinRT builds. Exported + symbols, namely XAUDIO2_bootstrap, uses 'extern "C"' to make sure the + rest of SDL can access it. Non-WinRT builds continue to compile + SDL_xaudio2.c as a C file. + 2. A macro redefines variables named 'this' to '_this', to prevent compiler + errors (C2355 in Visual C++) related to 'this' being a reserverd keyword. + This hack may need to be altered in the future, particularly if C++'s + 'this' keyword needs to be used (within SDL_xaudio2.c). At the time + WinRT support was initially added to SDL's XAudio2 backend, this + capability was not needed. + 3. The C-style macros to invoke XAudio2's COM-based methods were + rewritten to be C++-friendly. These are provided in the file, + SDL_xaudio2_winrthelpers.h. + 4. IXAudio2::CreateSourceVoice, when used in C++, requires its callbacks to + be specified via a C++ class. SDL's XAudio2 backend was written with + C-style callbacks. A class to bridge these two interfaces, + SDL_XAudio2VoiceCallback, was written to make XAudio2 happy. Its methods + just call SDL's existing, C-style callbacks. + 5. Multiple checks for the __cplusplus macro were made, in appropriate + places. + + + A few additional changes to SDL's XAudio2 backend were warranted by API + changes to Windows. Many, but not all of these are documented by Microsoft + at: + http://blogs.msdn.com/b/chuckw/archive/2012/04/02/xaudio2-and-windows-8-consumer-preview.aspx + + 1. Windows' thread synchronization function, CreateSemaphore, was removed + from Windows RT. SDL's semaphore API was substituted instead. + 2. The method calls, IXAudio2::GetDeviceCount and IXAudio2::GetDeviceDetails + were removed from the XAudio2 API. Microsoft is telling developers to + use APIs in Windows::Foundation instead. + For SDL, the missing methods were reimplemented using the APIs Microsoft + said to use. + 3. CoInitialize and CoUninitialize are not available in Windows RT. + These calls were removed, as COM will have been initialized earlier, + at least by the call to the WinRT app's main function + (aka 'int main(Platform::Array^)). (DLudwig: + This was my understanding of how WinRT: the 'main' function uses + a tag of [MTAThread], which should initialize COM. My understanding + of COM is somewhat limited, and I may be incorrect here.) + 4. IXAudio2::CreateMasteringVoice changed its integer-based 'DeviceIndex' + argument to a string-based one, 'szDeviceId'. In Windows RT, the + string-based argument will be used. +*/ + +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_XAUDIO2 + +#ifdef __cplusplus +extern "C" { +#endif +#include "../../core/windows/SDL_windows.h" +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" +#include "SDL_assert.h" +#ifdef __cplusplus +} +#endif + +#if defined(__WINRT__) +# define SDL_XAUDIO2_HAS_SDK 1 +#endif +#if defined(__WIN32__) +#ifdef __GNUC__ +/* The configure script already did any necessary checking */ +# define SDL_XAUDIO2_HAS_SDK 1 +#elif defined(__WINRT__) +/* WinRT always has access to the .the XAudio 2 SD +# define SDL_XAUDIO2_HAS_SDK +#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 + +#ifdef SDL_XAUDIO2_HAS_SDK + +#define INITGUID 1 +#include + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +#ifdef __cplusplus +#define this _this +#include "SDL_xaudio2_winrthelpers.h" +#endif + +struct SDL_PrivateAudioData +{ + IXAudio2 *ixa2; + IXAudio2SourceVoice *source; + IXAudio2MasteringVoice *mastering; + SDL_sem * semaphore; + Uint8 *mixbuf; + int mixlen; + Uint8 *nextbuf; +}; + + +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 = WIN_StringToUTF8(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; + SDL_SemPost(this->hidden->semaphore); +} + +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) {} + +#if defined(__cplusplus) +class SDL_XAudio2VoiceCallback : public IXAudio2VoiceCallback +{ +public: + STDMETHOD_(void, OnBufferEnd)(void *pBufferContext) { + VoiceCBOnBufferEnd(pBufferContext); + } + STDMETHOD_(void, OnBufferStart)(void *pBufferContext) { + VoiceCBOnBufferStart(pBufferContext); + } + STDMETHOD_(void, OnLoopEnd)(void *pBufferContext) { + VoiceCBOnLoopEnd(pBufferContext); + } + STDMETHOD_(void, OnStreamEnd)() { + VoiceCBOnStreamEnd(); + } + STDMETHOD_(void, OnVoiceError)(void *pBufferContext, HRESULT Error) { + VoiceCBOnVoiceError(pBufferContext, Error); + } + STDMETHOD_(void, OnVoiceProcessingPassEnd)() { + VoiceCBOnVoiceProcessPassEnd(); + } + STDMETHOD_(void, OnVoiceProcessingPassStart)(UINT32 BytesRequired) { + VoiceCBOnVoiceProcessPassStart(BytesRequired); + } +}; +#endif + +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) { + SDL_SemWait(this->hidden->semaphore); + } +} + +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) { + SDL_SemWait(this->hidden->semaphore); + 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) { + SDL_DestroySemaphore(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; +#if defined(__WINRT__) + WCHAR devIdBuffer[256]; + LPCWSTR devId = 0; +#else + UINT32 devId = 0; /* 0 == system default device. */ +#endif + +#if defined(__cplusplus) + static SDL_XAudio2VoiceCallback callbacks; +#else + static IXAudio2VoiceCallbackVtbl callbacks_vtable = { + VoiceCBOnVoiceProcessPassStart, + VoiceCBOnVoiceProcessPassEnd, + VoiceCBOnStreamEnd, + VoiceCBOnBufferStart, + VoiceCBOnBufferEnd, + VoiceCBOnLoopEnd, + VoiceCBOnVoiceError + }; + + static IXAudio2VoiceCallback callbacks = { &callbacks_vtable }; +#endif // ! defined(__cplusplus) + +#if defined(__WINRT__) + SDL_zero(devIdBuffer); +#endif + + 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."); + } + /* + XAUDIO2_DEBUG_CONFIGURATION debugConfig; + debugConfig.TraceMask = XAUDIO2_LOG_ERRORS; //XAUDIO2_LOG_WARNINGS | XAUDIO2_LOG_DETAIL | XAUDIO2_LOG_FUNC_CALLS | XAUDIO2_LOG_TIMING | XAUDIO2_LOG_LOCKS | XAUDIO2_LOG_MEMORY | XAUDIO2_LOG_STREAMING; + debugConfig.BreakMask = XAUDIO2_LOG_ERRORS; //XAUDIO2_LOG_WARNINGS; + debugConfig.LogThreadID = TRUE; + debugConfig.LogFileline = TRUE; + debugConfig.LogFunctionName = TRUE; + debugConfig.LogTiming = TRUE; + ixa2->SetDebugConfiguration(&debugConfig); + */ + +#if ! defined(__WINRT__) || WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP + 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 = WIN_StringToUTF8(details.DisplayName); + if (str != NULL) { + const int match = (SDL_strcmp(str, devname) == 0); + SDL_free(str); + if (match) { +#if defined(__WINRT__) + wcsncpy_s(devIdBuffer, ARRAYSIZE(devIdBuffer), details.DeviceID, _TRUNCATE); + devId = (LPCWSTR) &devIdBuffer; +#else + devId = i; +#endif + break; + } + } + } + } + + if (i == devcount) { + IXAudio2_Release(ixa2); + return SDL_SetError("XAudio2: Requested device not found."); + } + } +#endif + + /* 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 = SDL_CreateSemaphore(1); + 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; + waveformat.cbSize = sizeof(waveformat); + +#ifdef __WINRT__ + // DLudwig: for now, make XAudio2 do sample rate conversion, just to + // get the loopwave test to work. + // + // TODO, WinRT: consider removing WinRT-specific source-voice creation code from SDL_xaudio2.c + result = IXAudio2_CreateSourceVoice(ixa2, &source, &waveformat, + 0, + 1.0f, &callbacks, NULL, NULL); +#else + result = IXAudio2_CreateSourceVoice(ixa2, &source, &waveformat, + XAUDIO2_VOICE_NOSRC | + XAUDIO2_VOICE_NOPITCH, + 1.0f, &callbacks, NULL, NULL); + +#endif + 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) +{ +#if defined(__WIN32__) + WIN_CoUninitialize(); +#endif +} + +#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 defined(__WIN32__) + // TODO, WinRT: Investigate using CoInitializeEx here + if (FAILED(WIN_CoInitialize())) { + SDL_SetError("XAudio2: CoInitialize() failed"); + return 0; + } +#endif + + if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { +#if defined(__WIN32__) + WIN_CoUninitialize(); +#endif + 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 +} + +#if defined(__cplusplus) +extern "C" +#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/core/android/SDL_android.cpp b/src/core/android/SDL_android.c similarity index 55% rename from src/core/android/SDL_android.cpp rename to src/core/android/SDL_android.c index 5ae8f93a0..b7d1ff6d1 100644 --- a/src/core/android/SDL_android.cpp +++ b/src/core/android/SDL_android.c @@ -29,7 +29,6 @@ #include "SDL_android.h" #include -extern "C" { #include "../../events/SDL_events_c.h" #include "../../video/android/SDL_androidkeyboard.h" #include "../../video/android/SDL_androidtouch.h" @@ -48,15 +47,14 @@ extern "C" { /* Uncomment this to log messages entering and exiting methods in this file */ //#define DEBUG_JNI -/* Implemented in audio/android/SDL_androidaudio.c */ -extern void Android_RunAudioThread(); -} // C +static void Android_JNI_ThreadDestroyed(void*); /******************************************************************************* This file links the Java side of Android with libsdl *******************************************************************************/ #include #include +#include /******************************************************************************* @@ -70,6 +68,7 @@ static jclass mActivityClass; // method signatures static jmethodID midCreateGLContext; +static jmethodID midDeleteGLContext; static jmethodID midFlipBuffers; static jmethodID midAudioInit; static jmethodID midAudioWriteShortBuffer; @@ -85,12 +84,12 @@ static bool bHasNewData; *******************************************************************************/ // Library init -extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) +jint JNI_OnLoad(JavaVM* vm, void* reserved) { JNIEnv *env; mJavaVM = vm; LOGI("JNI_OnLoad called"); - if (mJavaVM->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) { + if ((*mJavaVM)->GetEnv(mJavaVM, (void**) &env, JNI_VERSION_1_4) != JNI_OK) { LOGE("Failed to get the environment using GetEnv()"); return -1; } @@ -109,25 +108,27 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) } // Called before SDL_main() to initialize JNI bindings -extern "C" void SDL_Android_Init(JNIEnv* mEnv, jclass cls) +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(cls); + mActivityClass = (jclass)((*mEnv)->NewGlobalRef(mEnv, cls)); - midCreateGLContext = mEnv->GetStaticMethodID(mActivityClass, + midCreateGLContext = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "createGLContext","(II[I)Z"); - midFlipBuffers = mEnv->GetStaticMethodID(mActivityClass, + midDeleteGLContext = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "deleteGLContext","()V"); + midFlipBuffers = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "flipBuffers","()V"); - midAudioInit = mEnv->GetStaticMethodID(mActivityClass, - "audioInit", "(IZZI)V"); - midAudioWriteShortBuffer = mEnv->GetStaticMethodID(mActivityClass, + midAudioInit = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "audioInit", "(IZZI)I"); + midAudioWriteShortBuffer = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "audioWriteShortBuffer", "([S)V"); - midAudioWriteByteBuffer = mEnv->GetStaticMethodID(mActivityClass, + midAudioWriteByteBuffer = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "audioWriteByteBuffer", "([B)V"); - midAudioQuit = mEnv->GetStaticMethodID(mActivityClass, + midAudioQuit = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "audioQuit", "()V"); bHasNewData = false; @@ -140,7 +141,7 @@ extern "C" void SDL_Android_Init(JNIEnv* mEnv, jclass cls) } // Resize -extern "C" void Java_org_libsdl_app_SDLActivity_onNativeResize( +void Java_org_libsdl_app_SDLActivity_onNativeResize( JNIEnv* env, jclass jcls, jint width, jint height, jint format) { @@ -148,21 +149,30 @@ extern "C" void Java_org_libsdl_app_SDLActivity_onNativeResize( } // Keydown -extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyDown( +void Java_org_libsdl_app_SDLActivity_onNativeKeyDown( JNIEnv* env, jclass jcls, jint keycode) { Android_OnKeyDown(keycode); } // Keyup -extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyUp( +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 -extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch( +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) @@ -171,7 +181,7 @@ extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch( } // Accelerometer -extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel( +void Java_org_libsdl_app_SDLActivity_onNativeAccel( JNIEnv* env, jclass jcls, jfloat x, jfloat y, jfloat z) { @@ -181,16 +191,24 @@ extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel( bHasNewData = true; } -// Quit -extern "C" void Java_org_libsdl_app_SDLActivity_nativeQuit( +// 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 -extern "C" void Java_org_libsdl_app_SDLActivity_nativePause( +void Java_org_libsdl_app_SDLActivity_nativePause( JNIEnv* env, jclass cls) { if (Android_Window) { @@ -199,12 +217,20 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativePause( 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 -extern "C" void Java_org_libsdl_app_SDLActivity_nativeResume( +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 @@ -216,35 +242,26 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativeResume( } } -extern "C" void Java_org_libsdl_app_SDLActivity_nativeRunAudioThread( - JNIEnv* env, jclass cls) -{ - /* This is the audio thread, with a different environment */ - Android_JNI_SetupThread(); - - Android_RunAudioThread(); -} - -extern "C" void Java_org_libsdl_app_SDLInputConnection_nativeCommitText( +void Java_org_libsdl_app_SDLInputConnection_nativeCommitText( JNIEnv* env, jclass cls, jstring text, jint newCursorPosition) { - const char *utftext = env->GetStringUTFChars(text, NULL); + const char *utftext = (*env)->GetStringUTFChars(env, text, NULL); SDL_SendKeyboardText(utftext); - env->ReleaseStringUTFChars(text, utftext); + (*env)->ReleaseStringUTFChars(env, text, utftext); } -extern "C" void Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText( +void Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText( JNIEnv* env, jclass cls, jstring text, jint newCursorPosition) { - const char *utftext = env->GetStringUTFChars(text, NULL); + const char *utftext = (*env)->GetStringUTFChars(env, text, NULL); SDL_SendEditingText(utftext, 0, 0); - env->ReleaseStringUTFChars(text, utftext); + (*env)->ReleaseStringUTFChars(env, text, utftext); } @@ -253,49 +270,55 @@ extern "C" void Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText( Functions called by SDL into Java *******************************************************************************/ -class LocalReferenceHolder +static int s_active = 0; +struct LocalReferenceHolder { -private: - static int s_active; - -public: - static bool IsActive() { - return s_active > 0; - } - -public: - LocalReferenceHolder(const char *func) : m_env(NULL), m_func(func) { -#ifdef DEBUG_JNI - SDL_Log("Entering function %s", m_func); -#endif - } - ~LocalReferenceHolder() { -#ifdef DEBUG_JNI - SDL_Log("Leaving function %s", m_func); -#endif - if (m_env) { - m_env->PopLocalFrame(NULL); - --s_active; - } - } - - bool init(JNIEnv *env, jint capacity = 16) { - if (env->PushLocalFrame(capacity) < 0) { - SDL_SetError("Failed to allocate enough JVM local references"); - return false; - } - ++s_active; - m_env = env; - return true; - } - -protected: JNIEnv *m_env; const char *m_func; }; -int LocalReferenceHolder::s_active; -extern "C" SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion, +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) @@ -319,35 +342,43 @@ extern "C" SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion jintArray array; - array = env->NewIntArray(len); - env->SetIntArrayRegion(array, 0, len, attribs); + array = (*env)->NewIntArray(env, len); + (*env)->SetIntArrayRegion(env, array, 0, len, attribs); - jboolean success = env->CallStaticBooleanMethod(mActivityClass, midCreateGLContext, majorVersion, minorVersion, array); + jboolean success = (*env)->CallStaticBooleanMethod(env, mActivityClass, midCreateGLContext, majorVersion, minorVersion, array); - env->DeleteLocalRef(array); + (*env)->DeleteLocalRef(env, array); return success ? SDL_TRUE : SDL_FALSE; } -extern "C" void Android_JNI_SwapWindow() +SDL_bool Android_JNI_DeleteContext(void) { - JNIEnv *mEnv = Android_JNI_GetEnv(); - mEnv->CallStaticVoidMethod(mActivityClass, midFlipBuffers); + /* There's only one context, so no parameter for now */ + JNIEnv *env = Android_JNI_GetEnv(); + (*env)->CallStaticVoidMethod(env, mActivityClass, midDeleteGLContext); + return SDL_TRUE; } -extern "C" void Android_JNI_SetActivityTitle(const char *title) +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(mActivityClass,"setActivityTitle","(Ljava/lang/String;)V"); + mid = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,"setActivityTitle","(Ljava/lang/String;)Z"); if (mid) { - jstring jtitle = reinterpret_cast(mEnv->NewStringUTF(title)); - mEnv->CallStaticVoidMethod(mActivityClass, mid, jtitle); - mEnv->DeleteLocalRef(jtitle); + jstring jtitle = (jstring)((*mEnv)->NewStringUTF(mEnv, title)); + (*mEnv)->CallStaticBooleanMethod(mEnv, mActivityClass, mid, jtitle); + (*mEnv)->DeleteLocalRef(mEnv, jtitle); } } -extern "C" SDL_bool Android_JNI_GetAccelerometerValues(float values[3]) +SDL_bool Android_JNI_GetAccelerometerValues(float values[3]) { int i; SDL_bool retval = SDL_FALSE; @@ -367,7 +398,7 @@ 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)->DetachCurrentThread(mJavaVM); pthread_setspecific(mThreadKey, NULL); } } @@ -386,7 +417,7 @@ JNIEnv* Android_JNI_GetEnv(void) { */ JNIEnv *env; - int status = mJavaVM->AttachCurrentThread(&env, NULL); + int status = (*mJavaVM)->AttachCurrentThread(mJavaVM, &env, NULL); if(status < 0) { LOGE("failed to attach current thread"); return 0; @@ -418,11 +449,10 @@ static jboolean audioBufferStereo = JNI_FALSE; static jobject audioBuffer = NULL; static void* audioBufferPinned = NULL; -extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames) +int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames) { int audioBufferFrames; - int status; JNIEnv *env = Android_JNI_GetEnv(); if (!env) { @@ -434,23 +464,27 @@ extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int chan audioBuffer16Bit = is16Bit; audioBufferStereo = channelCount > 1; - env->CallStaticVoidMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames); + 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(desiredBufferFrames * (audioBufferStereo ? 2 : 1)); + jshortArray audioBufferLocal = (*env)->NewShortArray(env, desiredBufferFrames * (audioBufferStereo ? 2 : 1)); if (audioBufferLocal) { - audioBuffer = env->NewGlobalRef(audioBufferLocal); - env->DeleteLocalRef(audioBufferLocal); + audioBuffer = (*env)->NewGlobalRef(env, audioBufferLocal); + (*env)->DeleteLocalRef(env, audioBufferLocal); } } else { - jbyteArray audioBufferLocal = env->NewByteArray(desiredBufferFrames * (audioBufferStereo ? 2 : 1)); + jbyteArray audioBufferLocal = (*env)->NewByteArray(env, desiredBufferFrames * (audioBufferStereo ? 2 : 1)); if (audioBufferLocal) { - audioBuffer = env->NewGlobalRef(audioBufferLocal); - env->DeleteLocalRef(audioBufferLocal); + audioBuffer = (*env)->NewGlobalRef(env, audioBufferLocal); + (*env)->DeleteLocalRef(env, audioBufferLocal); } } @@ -461,11 +495,11 @@ extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int chan jboolean isCopy = JNI_FALSE; if (audioBuffer16Bit) { - audioBufferPinned = env->GetShortArrayElements((jshortArray)audioBuffer, &isCopy); - audioBufferFrames = env->GetArrayLength((jshortArray)audioBuffer); + audioBufferPinned = (*env)->GetShortArrayElements(env, (jshortArray)audioBuffer, &isCopy); + audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)audioBuffer); } else { - audioBufferPinned = env->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy); - audioBufferFrames = env->GetArrayLength((jbyteArray)audioBuffer); + audioBufferPinned = (*env)->GetByteArrayElements(env, (jbyteArray)audioBuffer, &isCopy); + audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)audioBuffer); } if (audioBufferStereo) { audioBufferFrames /= 2; @@ -474,74 +508,73 @@ extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int chan return audioBufferFrames; } -extern "C" void * Android_JNI_GetAudioBuffer() +void * Android_JNI_GetAudioBuffer() { return audioBufferPinned; } -extern "C" void Android_JNI_WriteAudioBuffer() +void Android_JNI_WriteAudioBuffer() { JNIEnv *mAudioEnv = Android_JNI_GetEnv(); if (audioBuffer16Bit) { - mAudioEnv->ReleaseShortArrayElements((jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT); - mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteShortBuffer, (jshortArray)audioBuffer); + (*mAudioEnv)->ReleaseShortArrayElements(mAudioEnv, (jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT); + (*mAudioEnv)->CallStaticVoidMethod(mAudioEnv, mActivityClass, midAudioWriteShortBuffer, (jshortArray)audioBuffer); } else { - mAudioEnv->ReleaseByteArrayElements((jbyteArray)audioBuffer, (jbyte *)audioBufferPinned, JNI_COMMIT); - mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteByteBuffer, (jbyteArray)audioBuffer); + (*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 */ } -extern "C" void Android_JNI_CloseAudioDevice() +void Android_JNI_CloseAudioDevice() { - int status; JNIEnv *env = Android_JNI_GetEnv(); - env->CallStaticVoidMethod(mActivityClass, midAudioQuit); + (*env)->CallStaticVoidMethod(env, mActivityClass, midAudioQuit); if (audioBuffer) { - env->DeleteGlobalRef(audioBuffer); + (*env)->DeleteGlobalRef(env, audioBuffer); audioBuffer = NULL; audioBufferPinned = NULL; } } // Test for an exception and call SDL_SetError with its detail if one occurs -// If optional parameter silent is truthy then SDL_SetError() is not called. -static bool Android_JNI_ExceptionOccurred(bool silent = false) +// If the parameter silent is truthy then SDL_SetError() will not be called. +static bool Android_JNI_ExceptionOccurred(bool silent) { - SDL_assert(LocalReferenceHolder::IsActive()); + SDL_assert(LocalReferenceHolder_IsActive()); JNIEnv *mEnv = Android_JNI_GetEnv(); - jthrowable exception = mEnv->ExceptionOccurred(); + jthrowable exception = (*mEnv)->ExceptionOccurred(mEnv); if (exception != NULL) { jmethodID mid; // Until this happens most JNI operations have undefined behaviour - mEnv->ExceptionClear(); + (*mEnv)->ExceptionClear(mEnv); if (!silent) { - jclass exceptionClass = mEnv->GetObjectClass(exception); - jclass classClass = mEnv->FindClass("java/lang/Class"); + jclass exceptionClass = (*mEnv)->GetObjectClass(mEnv, exception); + jclass classClass = (*mEnv)->FindClass(mEnv, "java/lang/Class"); - mid = mEnv->GetMethodID(classClass, "getName", "()Ljava/lang/String;"); - jstring exceptionName = (jstring)mEnv->CallObjectMethod(exceptionClass, mid); - const char* exceptionNameUTF8 = mEnv->GetStringUTFChars(exceptionName, 0); + 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(exceptionClass, "getMessage", "()Ljava/lang/String;"); - jstring exceptionMessage = (jstring)mEnv->CallObjectMethod(exception, mid); + 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(exceptionMessage, 0); + const char* exceptionMessageUTF8 = (*mEnv)->GetStringUTFChars(mEnv, exceptionMessage, 0); SDL_SetError("%s: %s", exceptionNameUTF8, exceptionMessageUTF8); - mEnv->ReleaseStringUTFChars(exceptionMessage, exceptionMessageUTF8); + (*mEnv)->ReleaseStringUTFChars(mEnv, exceptionMessage, exceptionMessageUTF8); } else { SDL_SetError("%s", exceptionNameUTF8); } - mEnv->ReleaseStringUTFChars(exceptionName, exceptionNameUTF8); + (*mEnv)->ReleaseStringUTFChars(mEnv, exceptionName, exceptionNameUTF8); } return true; @@ -550,9 +583,10 @@ static bool Android_JNI_ExceptionOccurred(bool silent = false) return false; } -static int Android_JNI_FileOpen(SDL_RWops* ctx) +static int Internal_Android_JNI_FileOpen(SDL_RWops* ctx) { - LocalReferenceHolder refs(__FUNCTION__); + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + int result = 0; jmethodID mid; @@ -567,7 +601,7 @@ static int Android_JNI_FileOpen(SDL_RWops* ctx) jfieldID descriptor; JNIEnv *mEnv = Android_JNI_GetEnv(); - if (!refs.init(mEnv)) { + if (!LocalReferenceHolder_Init(&refs, mEnv)) { goto failure; } @@ -575,62 +609,64 @@ static int Android_JNI_FileOpen(SDL_RWops* ctx) ctx->hidden.androidio.position = 0; // context = SDLActivity.getContext(); - mid = mEnv->GetStaticMethodID(mActivityClass, + mid = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "getContext","()Landroid/content/Context;"); - context = mEnv->CallStaticObjectMethod(mActivityClass, mid); - + context = (*mEnv)->CallStaticObjectMethod(mEnv, mActivityClass, mid); + // assetManager = context.getAssets(); - mid = mEnv->GetMethodID(mEnv->GetObjectClass(context), + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, context), "getAssets", "()Landroid/content/res/AssetManager;"); - assetManager = mEnv->CallObjectMethod(context, mid); + 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->GetObjectClass(assetManager), "openFd", "(Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;"); - inputStream = mEnv->CallObjectMethod(assetManager, mid, fileNameJString); + 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->GetObjectClass(inputStream), "getStartOffset", "()J"); - ctx->hidden.androidio.offset = mEnv->CallLongMethod(inputStream, mid); + 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->GetObjectClass(inputStream), "getDeclaredLength", "()J"); - ctx->hidden.androidio.size = mEnv->CallLongMethod(inputStream, mid); + 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->GetObjectClass(inputStream), "getFileDescriptor", "()Ljava/io/FileDescriptor;"); - fd = mEnv->CallObjectMethod(inputStream, mid); - fdCls = mEnv->GetObjectClass(fd); - descriptor = mEnv->GetFieldID(fdCls, "descriptor", "I"); - ctx->hidden.androidio.fd = mEnv->GetIntField(fd, descriptor); - ctx->hidden.androidio.assetFileDescriptorRef = mEnv->NewGlobalRef(inputStream); + 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: - __android_log_print(ANDROID_LOG_DEBUG, "SDL", "Falling back to legacy InputStream method for opening file"); + // 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->GetObjectClass(assetManager), + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, assetManager), "open", "(Ljava/lang/String;I)Ljava/io/InputStream;"); - inputStream = mEnv->CallObjectMethod(assetManager, mid, fileNameJString, 1 /*ACCESS_RANDOM*/); - if (Android_JNI_ExceptionOccurred()) { + inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString, 1 /*ACCESS_RANDOM*/); + if (Android_JNI_ExceptionOccurred(false)) { goto failure; } - ctx->hidden.androidio.inputStreamRef = mEnv->NewGlobalRef(inputStream); + 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 @@ -639,29 +675,29 @@ fallback: // AssetInputStream.available() /will/ always return the total file size // size = inputStream.available(); - mid = mEnv->GetMethodID(mEnv->GetObjectClass(inputStream), + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "available", "()I"); - ctx->hidden.androidio.size = (long)mEnv->CallIntMethod(inputStream, mid); - if (Android_JNI_ExceptionOccurred()) { + ctx->hidden.androidio.size = (long)(*mEnv)->CallIntMethod(mEnv, inputStream, mid); + if (Android_JNI_ExceptionOccurred(false)) { goto failure; } // readableByteChannel = Channels.newChannel(inputStream); - channels = mEnv->FindClass("java/nio/channels/Channels"); - mid = mEnv->GetStaticMethodID(channels, + channels = (*mEnv)->FindClass(mEnv, "java/nio/channels/Channels"); + mid = (*mEnv)->GetStaticMethodID(mEnv, channels, "newChannel", "(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;"); - readableByteChannel = mEnv->CallStaticObjectMethod( - channels, mid, inputStream); - if (Android_JNI_ExceptionOccurred()) { + readableByteChannel = (*mEnv)->CallStaticObjectMethod( + mEnv, channels, mid, inputStream); + if (Android_JNI_ExceptionOccurred(false)) { goto failure; } ctx->hidden.androidio.readableByteChannelRef = - mEnv->NewGlobalRef(readableByteChannel); + (*mEnv)->NewGlobalRef(mEnv, readableByteChannel); // Store .read id for reading purposes - mid = mEnv->GetMethodID(mEnv->GetObjectClass(readableByteChannel), + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, readableByteChannel), "read", "(Ljava/nio/ByteBuffer;)I"); ctx->hidden.androidio.readMethod = mid; } @@ -670,53 +706,59 @@ fallback: failure: result = -1; - mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.fileNameRef); + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.fileNameRef); if(ctx->hidden.androidio.inputStreamRef != NULL) { - mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.inputStreamRef); + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.inputStreamRef); } if(ctx->hidden.androidio.readableByteChannelRef != NULL) { - mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.readableByteChannelRef); + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.readableByteChannelRef); } if(ctx->hidden.androidio.assetFileDescriptorRef != NULL) { - mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.assetFileDescriptorRef); + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.assetFileDescriptorRef); } } - + + LocalReferenceHolder_Cleanup(&refs); return result; } -extern "C" int Android_JNI_FileOpen(SDL_RWops* ctx, - const char* fileName, const char*) +int Android_JNI_FileOpen(SDL_RWops* ctx, + const char* fileName, const char* mode) { - LocalReferenceHolder refs(__FUNCTION__); + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); JNIEnv *mEnv = Android_JNI_GetEnv(); + int retval; - if (!refs.init(mEnv)) { + if (!LocalReferenceHolder_Init(&refs, mEnv)) { + LocalReferenceHolder_Cleanup(&refs); return -1; } if (!ctx) { + LocalReferenceHolder_Cleanup(&refs); return -1; } - jstring fileNameJString = mEnv->NewStringUTF(fileName); - ctx->hidden.androidio.fileNameRef = mEnv->NewGlobalRef(fileNameJString); + 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; - return Android_JNI_FileOpen(ctx); + retval = Internal_Android_JNI_FileOpen(ctx); + LocalReferenceHolder_Cleanup(&refs); + return retval; } -extern "C" size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, +size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, size_t size, size_t maxnum) { - LocalReferenceHolder refs(__FUNCTION__); + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); if (ctx->hidden.androidio.assetFileDescriptorRef) { size_t bytesMax = size * maxnum; @@ -726,8 +768,10 @@ extern "C" size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, 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); @@ -738,19 +782,21 @@ extern "C" size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, if (bytesRemaining > bytesMax) bytesRemaining = bytesMax; JNIEnv *mEnv = Android_JNI_GetEnv(); - if (!refs.init(mEnv)) { - return -1; + 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(buffer, bytesRemaining); + jobject byteBuffer = (*mEnv)->NewDirectByteBuffer(mEnv, buffer, bytesRemaining); while (bytesRemaining > 0) { // result = readableByteChannel.read(...); - int result = mEnv->CallIntMethod(readableByteChannel, readMethod, byteBuffer); + int result = (*mEnv)->CallIntMethod(mEnv, readableByteChannel, readMethod, byteBuffer); - if (Android_JNI_ExceptionOccurred()) { + if (Android_JNI_ExceptionOccurred(false)) { + LocalReferenceHolder_Cleanup(&refs); return 0; } @@ -762,39 +808,42 @@ extern "C" size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, bytesRead += result; ctx->hidden.androidio.position += result; } + LocalReferenceHolder_Cleanup(&refs); return bytesRead / size; - } + } } -extern "C" size_t Android_JNI_FileWrite(SDL_RWops* ctx, const void* buffer, +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 Android_JNI_FileClose(SDL_RWops* ctx, bool release) +static int Internal_Android_JNI_FileClose(SDL_RWops* ctx, bool release) { - LocalReferenceHolder refs(__FUNCTION__); + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + int result = 0; JNIEnv *mEnv = Android_JNI_GetEnv(); - if (!refs.init(mEnv)) { + if (!LocalReferenceHolder_Init(&refs, mEnv)) { + LocalReferenceHolder_Cleanup(&refs); return SDL_SetError("Failed to allocate enough JVM local references"); } if (ctx) { if (release) { - mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.fileNameRef); + (*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->GetObjectClass(inputStream), + jmethodID mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "close", "()V"); - mEnv->CallVoidMethod(inputStream, mid); - mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.assetFileDescriptorRef); - if (Android_JNI_ExceptionOccurred()) { + (*mEnv)->CallVoidMethod(mEnv, inputStream, mid); + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.assetFileDescriptorRef); + if (Android_JNI_ExceptionOccurred(false)) { result = -1; } } @@ -802,12 +851,12 @@ static int Android_JNI_FileClose(SDL_RWops* ctx, bool release) jobject inputStream = (jobject)ctx->hidden.androidio.inputStreamRef; // inputStream.close(); - jmethodID mid = mEnv->GetMethodID(mEnv->GetObjectClass(inputStream), + jmethodID mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "close", "()V"); - mEnv->CallVoidMethod(inputStream, mid); - mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.inputStreamRef); - mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.readableByteChannelRef); - if (Android_JNI_ExceptionOccurred()) { + (*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; } } @@ -817,16 +866,17 @@ static int Android_JNI_FileClose(SDL_RWops* ctx, bool release) } } + LocalReferenceHolder_Cleanup(&refs); return result; } -extern "C" Sint64 Android_JNI_FileSize(SDL_RWops* ctx) +Sint64 Android_JNI_FileSize(SDL_RWops* ctx) { return ctx->hidden.androidio.size; } -extern "C" Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence) +Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence) { if (ctx->hidden.androidio.assetFileDescriptorRef) { switch (whence) { @@ -897,95 +947,117 @@ extern "C" Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence } 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 - Android_JNI_FileClose(ctx, false); - Android_JNI_FileOpen(ctx); + Internal_Android_JNI_FileClose(ctx, false); + Internal_Android_JNI_FileOpen(ctx); Android_JNI_FileSeek(ctx, newPosition, RW_SEEK_SET); } } return ctx->hidden.androidio.position; - + } -extern "C" int Android_JNI_FileClose(SDL_RWops* ctx) +int Android_JNI_FileClose(SDL_RWops* ctx) { - return Android_JNI_FileClose(ctx, true); + 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) { - LocalReferenceHolder refs(__FUNCTION__); + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); JNIEnv* env = Android_JNI_GetEnv(); - if (!refs.init(env)) { + jobject retval = NULL; + + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); return NULL; } - jstring service = env->NewStringUTF(name); + jstring service = (*env)->NewStringUTF(env, name); jmethodID mid; - mid = env->GetStaticMethodID(mActivityClass, "getContext", "()Landroid/content/Context;"); - jobject context = env->CallStaticObjectMethod(mActivityClass, mid); + mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;"); + jobject context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); - mid = env->GetMethodID(mActivityClass, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;"); - jobject manager = env->CallObjectMethod(context, mid, service); + mid = (*env)->GetMethodID(env, mActivityClass, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;"); + jobject manager = (*env)->CallObjectMethod(env, context, mid, service); - env->DeleteLocalRef(service); + (*env)->DeleteLocalRef(env, service); - return manager ? env->NewGlobalRef(manager) : NULL; + retval = manager ? (*env)->NewGlobalRef(env, manager) : NULL; + LocalReferenceHolder_Cleanup(&refs); + return retval; } #define SETUP_CLIPBOARD(error) \ - LocalReferenceHolder refs(__FUNCTION__); \ + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); \ JNIEnv* env = Android_JNI_GetEnv(); \ - if (!refs.init(env)) { \ + if (!LocalReferenceHolder_Init(&refs, env)) { \ + LocalReferenceHolder_Cleanup(&refs); \ return error; \ } \ jobject clipboard = Android_JNI_GetSystemServiceObject("clipboard"); \ if (!clipboard) { \ + LocalReferenceHolder_Cleanup(&refs); \ return error; \ } -extern "C" int Android_JNI_SetClipboardText(const char* text) +#define CLEANUP_CLIPBOARD() \ + LocalReferenceHolder_Cleanup(&refs); + +int Android_JNI_SetClipboardText(const char* text) { SETUP_CLIPBOARD(-1) - jmethodID mid = env->GetMethodID(env->GetObjectClass(clipboard), "setText", "(Ljava/lang/CharSequence;)V"); - jstring string = env->NewStringUTF(text); - env->CallVoidMethod(clipboard, mid, string); - env->DeleteGlobalRef(clipboard); - env->DeleteLocalRef(string); + 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; } -extern "C" char* Android_JNI_GetClipboardText() +char* Android_JNI_GetClipboardText() { SETUP_CLIPBOARD(SDL_strdup("")) - jmethodID mid = env->GetMethodID(env->GetObjectClass(clipboard), "getText", "()Ljava/lang/CharSequence;"); - jobject sequence = env->CallObjectMethod(clipboard, mid); - env->DeleteGlobalRef(clipboard); + 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->GetObjectClass(sequence), "toString", "()Ljava/lang/String;"); - jstring string = reinterpret_cast(env->CallObjectMethod(sequence, mid)); - const char* utf = env->GetStringUTFChars(string, 0); + 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(string, utf); + (*env)->ReleaseStringUTFChars(env, string, utf); + + CLEANUP_CLIPBOARD(); + return text; } } + + CLEANUP_CLIPBOARD(); + return SDL_strdup(""); } -extern "C" SDL_bool Android_JNI_HasClipboardText() +SDL_bool Android_JNI_HasClipboardText() { SETUP_CLIPBOARD(SDL_FALSE) - jmethodID mid = env->GetMethodID(env->GetObjectClass(clipboard), "hasText", "()Z"); - jboolean has = env->CallBooleanMethod(clipboard, mid); - env->DeleteGlobalRef(clipboard); + 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; } @@ -993,54 +1065,56 @@ extern "C" SDL_bool Android_JNI_HasClipboardText() // 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 -extern "C" int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent) +int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent) { - LocalReferenceHolder refs(__FUNCTION__); + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); JNIEnv* env = Android_JNI_GetEnv(); - if (!refs.init(env)) { + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); return -1; } jmethodID mid; - mid = env->GetStaticMethodID(mActivityClass, "getContext", "()Landroid/content/Context;"); - jobject context = env->CallStaticObjectMethod(mActivityClass, mid); + mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;"); + jobject context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); - jstring action = env->NewStringUTF("android.intent.action.BATTERY_CHANGED"); + jstring action = (*env)->NewStringUTF(env, "android.intent.action.BATTERY_CHANGED"); - jclass cls = env->FindClass("android/content/IntentFilter"); + jclass cls = (*env)->FindClass(env, "android/content/IntentFilter"); - mid = env->GetMethodID(cls, "", "(Ljava/lang/String;)V"); - jobject filter = env->NewObject(cls, mid, action); + mid = (*env)->GetMethodID(env, cls, "", "(Ljava/lang/String;)V"); + jobject filter = (*env)->NewObject(env, cls, mid, action); - env->DeleteLocalRef(action); + (*env)->DeleteLocalRef(env, action); - mid = env->GetMethodID(mActivityClass, "registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;"); - jobject intent = env->CallObjectMethod(context, mid, NULL, filter); + 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(filter); + (*env)->DeleteLocalRef(env, filter); - cls = env->GetObjectClass(intent); + cls = (*env)->GetObjectClass(env, intent); jstring iname; - jmethodID imid = env->GetMethodID(cls, "getIntExtra", "(Ljava/lang/String;I)I"); + jmethodID imid = (*env)->GetMethodID(env, cls, "getIntExtra", "(Ljava/lang/String;I)I"); #define GET_INT_EXTRA(var, key) \ - iname = env->NewStringUTF(key); \ - int var = env->CallIntMethod(intent, imid, iname, -1); \ - env->DeleteLocalRef(iname); + iname = (*env)->NewStringUTF(env, key); \ + int var = (*env)->CallIntMethod(env, intent, imid, iname, -1); \ + (*env)->DeleteLocalRef(env, iname); jstring bname; - jmethodID bmid = env->GetMethodID(cls, "getBooleanExtra", "(Ljava/lang/String;Z)Z"); + jmethodID bmid = (*env)->GetMethodID(env, cls, "getBooleanExtra", "(Ljava/lang/String;Z)Z"); #define GET_BOOL_EXTRA(var, key) \ - bname = env->NewStringUTF(key); \ - int var = env->CallBooleanMethod(intent, bmid, bname, JNI_FALSE); \ - env->DeleteLocalRef(bname); + 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 @@ -1051,6 +1125,7 @@ extern "C" int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery 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 @@ -1070,50 +1145,52 @@ extern "C" int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery 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(intent); + (*env)->DeleteLocalRef(env, intent); + LocalReferenceHolder_Cleanup(&refs); return 0; } // sends message to be handled on the UI event dispatch thread -extern "C" int Android_JNI_SendMessage(int command, int param) +int Android_JNI_SendMessage(int command, int param) { JNIEnv *env = Android_JNI_GetEnv(); if (!env) { return -1; } - jmethodID mid = env->GetStaticMethodID(mActivityClass, "sendMessage", "(II)V"); + jmethodID mid = (*env)->GetStaticMethodID(env, mActivityClass, "sendMessage", "(II)Z"); if (!mid) { return -1; } - env->CallStaticVoidMethod(mActivityClass, mid, command, param); - return 0; + jboolean success = (*env)->CallStaticBooleanMethod(env, mActivityClass, mid, command, param); + return success ? 0 : -1; } -extern "C" void Android_JNI_ShowTextInput(SDL_Rect *inputRect) +void Android_JNI_ShowTextInput(SDL_Rect *inputRect) { JNIEnv *env = Android_JNI_GetEnv(); if (!env) { return; } - jmethodID mid = env->GetStaticMethodID(mActivityClass, "showTextInput", "(IIII)V"); + jmethodID mid = (*env)->GetStaticMethodID(env, mActivityClass, "showTextInput", "(IIII)Z"); if (!mid) { return; } - env->CallStaticVoidMethod( mActivityClass, mid, + (*env)->CallStaticBooleanMethod(env, mActivityClass, mid, inputRect->x, inputRect->y, inputRect->w, inputRect->h ); } -extern "C" void Android_JNI_HideTextInput() +void Android_JNI_HideTextInput() { // has to match Activity constant const int COMMAND_TEXTEDIT_HIDE = 3; @@ -1125,33 +1202,36 @@ extern "C" void Android_JNI_HideTextInput() // Functions exposed to SDL applications in SDL_system.h // -extern "C" void *SDL_AndroidGetJNIEnv() +void *SDL_AndroidGetJNIEnv() { return Android_JNI_GetEnv(); } -extern "C" void *SDL_AndroidGetActivity() + + +void *SDL_AndroidGetActivity() { - LocalReferenceHolder refs(__FUNCTION__); + /* See SDL_system.h for caveats on using this function. */ + jmethodID mid; JNIEnv *env = Android_JNI_GetEnv(); - if (!refs.init(env)) { + if (!env) { return NULL; } // return SDLActivity.getContext(); - mid = env->GetStaticMethodID(mActivityClass, + mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext","()Landroid/content/Context;"); - return env->CallStaticObjectMethod(mActivityClass, mid); + return (*env)->CallStaticObjectMethod(env, mActivityClass, mid); } -extern "C" const char * SDL_AndroidGetInternalStoragePath() +const char * SDL_AndroidGetInternalStoragePath() { static char *s_AndroidInternalFilesPath = NULL; if (!s_AndroidInternalFilesPath) { - LocalReferenceHolder refs(__FUNCTION__); + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); jmethodID mid; jobject context; jobject fileObject; @@ -1159,39 +1239,43 @@ extern "C" const char * SDL_AndroidGetInternalStoragePath() const char *path; JNIEnv *env = Android_JNI_GetEnv(); - if (!refs.init(env)) { + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); return NULL; } // context = SDLActivity.getContext(); - mid = env->GetStaticMethodID(mActivityClass, + mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext","()Landroid/content/Context;"); - context = env->CallStaticObjectMethod(mActivityClass, mid); + context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); // fileObj = context.getFilesDir(); - mid = env->GetMethodID(env->GetObjectClass(context), + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context), "getFilesDir", "()Ljava/io/File;"); - fileObject = env->CallObjectMethod(context, mid); + 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->GetObjectClass(fileObject), + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject), "getAbsolutePath", "()Ljava/lang/String;"); - pathString = (jstring)env->CallObjectMethod(fileObject, mid); + pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid); - path = env->GetStringUTFChars(pathString, NULL); + path = (*env)->GetStringUTFChars(env, pathString, NULL); s_AndroidInternalFilesPath = SDL_strdup(path); - env->ReleaseStringUTFChars(pathString, path); + (*env)->ReleaseStringUTFChars(env, pathString, path); + + LocalReferenceHolder_Cleanup(&refs); } return s_AndroidInternalFilesPath; } -extern "C" int SDL_AndroidGetExternalStorageState() +int SDL_AndroidGetExternalStorageState() { - LocalReferenceHolder refs(__FUNCTION__); + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); jmethodID mid; jclass cls; jstring stateString; @@ -1199,16 +1283,17 @@ extern "C" int SDL_AndroidGetExternalStorageState() int stateFlags; JNIEnv *env = Android_JNI_GetEnv(); - if (!refs.init(env)) { + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); return 0; } - cls = env->FindClass("android/os/Environment"); - mid = env->GetStaticMethodID(cls, + cls = (*env)->FindClass(env, "android/os/Environment"); + mid = (*env)->GetStaticMethodID(env, cls, "getExternalStorageState", "()Ljava/lang/String;"); - stateString = (jstring)env->CallStaticObjectMethod(cls, mid); + stateString = (jstring)(*env)->CallStaticObjectMethod(env, cls, mid); - state = env->GetStringUTFChars(stateString, NULL); + 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); @@ -1221,17 +1306,18 @@ extern "C" int SDL_AndroidGetExternalStorageState() } else { stateFlags = 0; } - env->ReleaseStringUTFChars(stateString, state); + (*env)->ReleaseStringUTFChars(env, stateString, state); + LocalReferenceHolder_Cleanup(&refs); return stateFlags; } -extern "C" const char * SDL_AndroidGetExternalStoragePath() +const char * SDL_AndroidGetExternalStoragePath() { static char *s_AndroidExternalFilesPath = NULL; if (!s_AndroidExternalFilesPath) { - LocalReferenceHolder refs(__FUNCTION__); + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); jmethodID mid; jobject context; jobject fileObject; @@ -1239,32 +1325,36 @@ extern "C" const char * SDL_AndroidGetExternalStoragePath() const char *path; JNIEnv *env = Android_JNI_GetEnv(); - if (!refs.init(env)) { + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); return NULL; } // context = SDLActivity.getContext(); - mid = env->GetStaticMethodID(mActivityClass, + mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext","()Landroid/content/Context;"); - context = env->CallStaticObjectMethod(mActivityClass, mid); + context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); // fileObj = context.getExternalFilesDir(); - mid = env->GetMethodID(env->GetObjectClass(context), + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context), "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;"); - fileObject = env->CallObjectMethod(context, mid, NULL); + 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->GetObjectClass(fileObject), + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject), "getAbsolutePath", "()Ljava/lang/String;"); - pathString = (jstring)env->CallObjectMethod(fileObject, mid); + pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid); - path = env->GetStringUTFChars(pathString, NULL); + path = (*env)->GetStringUTFChars(env, pathString, NULL); s_AndroidExternalFilesPath = SDL_strdup(path); - env->ReleaseStringUTFChars(pathString, path); + (*env)->ReleaseStringUTFChars(env, pathString, path); + + LocalReferenceHolder_Cleanup(&refs); } return s_AndroidExternalFilesPath; } @@ -1272,3 +1362,4 @@ extern "C" const char * SDL_AndroidGetExternalStoragePath() #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 index 7eddcfac8..973f5881f 100644 --- a/src/core/android/SDL_android.h +++ b/src/core/android/SDL_android.h @@ -31,13 +31,14 @@ extern "C" { /* 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 +/* 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(); @@ -60,13 +61,12 @@ SDL_bool Android_JNI_HasClipboardText(); /* Power support */ int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent); -// Threads +/* Threads */ #include -static void Android_JNI_ThreadDestroyed(void*); JNIEnv *Android_JNI_GetEnv(void); int Android_JNI_SetupThread(void); -// Generic messages +/* Generic messages */ int Android_JNI_SendMessage(int command, int param); /* Ends C function definitions when using C++ */ diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index ecba3bb5b..06cb0f2e7 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -33,6 +33,9 @@ #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; void *SDL_EventOKParam; @@ -53,17 +56,31 @@ static SDL_DisabledEventBlock *SDL_disabled_events[256]; static Uint32 SDL_userevents = SDL_USEREVENT; /* Private data -- event queue */ -#define MAXEVENTS 128 +typedef struct _SDL_EventEntry +{ + SDL_Event event; + SDL_SysWMmsg msg; + struct _SDL_EventEntry *prev; + struct _SDL_EventEntry *next; +} SDL_EventEntry; + +typedef struct _SDL_SysWMEntry +{ + SDL_SysWMmsg msg; + struct _SDL_SysWMEntry *next; +} SDL_SysWMEntry; + 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 = { NULL, 1 }; + 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 @@ -85,18 +102,42 @@ void SDL_StopEventLoop(void) { int i; - - SDL_EventQ.active = 0; + SDL_EventEntry *entry; + SDL_SysWMEntry *wmmsg; if (SDL_EventQ.lock) { - SDL_DestroyMutex(SDL_EventQ.lock); - SDL_EventQ.lock = NULL; + SDL_LockMutex(SDL_EventQ.lock); } + SDL_EventQ.active = SDL_FALSE; + /* Clean out EventQ */ - SDL_EventQ.head = 0; - SDL_EventQ.tail = 0; - SDL_EventQ.wmmsg_next = 0; + 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) { @@ -111,6 +152,13 @@ SDL_StopEventLoop(void) 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; + } } /* This function (and associated calls) may be called more than once */ @@ -133,13 +181,12 @@ SDL_StartEventLoop(void) } #endif /* !SDL_THREADS_DISABLED */ - /* No filter to start with, process most event types */ - SDL_EventOK = NULL; + /* Process most event types */ SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE); - SDL_EventQ.active = 1; + SDL_EventQ.active = SDL_TRUE; return (0); } @@ -149,55 +196,70 @@ SDL_StartEventLoop(void) static int SDL_AddEvent(SDL_Event * event) { - int tail, added; + SDL_EventEntry *entry; - 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; + if (SDL_EventQ.count >= SDL_MAX_QUEUED_EVENTS) { + SDL_SetError("Event queue is full (%d events)", SDL_EventQ.count); + return 0; } - return (added); + + 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; } -/* Cut an event, and return the next valid spot, or the tail */ -/* -- called with the queue locked */ -static int -SDL_CutEvent(int spot) +/* Remove an event from the queue -- called with the queue locked */ +static void +SDL_CutEvent(SDL_EventEntry *entry) { - 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); + if (entry->prev) { + entry->prev->next = entry->next; } - /* NOTREACHED */ + 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; } /* Lock the event queue, take a peep at it, and unlock it */ @@ -209,6 +271,10 @@ SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action, /* 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 */ @@ -219,8 +285,10 @@ SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action, used += SDL_AddEvent(&events[i]); } } else { + SDL_EventEntry *entry, *next; + SDL_SysWMEntry *wmmsg, *wmmsg_next; SDL_Event tmpevent; - int spot; + Uint32 type; /* If 'events' is NULL, just see if they exist */ if (events == NULL) { @@ -228,18 +296,44 @@ SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action, numevents = 1; events = &tmpevent; } - spot = SDL_EventQ.head; - while ((used < numevents) && (spot != SDL_EventQ.tail)) { - Uint32 type = SDL_EventQ.event[spot].type; + + /* 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++] = SDL_EventQ.event[spot]; - if (action == SDL_GETEVENT) { - spot = SDL_CutEvent(spot); - } else { - spot = (spot + 1) % MAXEVENTS; + 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); } - } else { - spot = (spot + 1) % MAXEVENTS; } } } @@ -286,13 +380,13 @@ SDL_FlushEvents(Uint32 minType, Uint32 maxType) /* Lock the event queue */ if (SDL_LockMutex(SDL_EventQ.lock) == 0) { - int spot = SDL_EventQ.head; - while (spot != SDL_EventQ.tail) { - Uint32 type = SDL_EventQ.event[spot].type; + 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) { - spot = SDL_CutEvent(spot); - } else { - spot = (spot + 1) % MAXEVENTS; + SDL_CutEvent(entry); } } SDL_UnlockMutex(SDL_EventQ.lock); @@ -365,7 +459,9 @@ int SDL_PushEvent(SDL_Event * event) { SDL_EventWatcher *curr; + event->common.timestamp = SDL_GetTicks(); + if (SDL_EventOK && !SDL_EventOK(SDL_EventOKParam, event)) { return 0; } @@ -386,12 +482,11 @@ SDL_PushEvent(SDL_Event * event) void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata) { - SDL_Event bitbucket; - /* Set filter and discard pending events */ - SDL_EventOK = filter; + SDL_EventOK = NULL; + SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT); SDL_EventOKParam = userdata; - while (SDL_PollEvent(&bitbucket) > 0); + SDL_EventOK = filter; } SDL_bool @@ -447,18 +542,15 @@ void SDL_FilterEvents(SDL_EventFilter filter, void *userdata) { if (SDL_LockMutex(SDL_EventQ.lock) == 0) { - int spot; - - spot = SDL_EventQ.head; - while (spot != SDL_EventQ.tail) { - if (filter(userdata, &SDL_EventQ.event[spot])) { - spot = (spot + 1) % MAXEVENTS; - } else { - spot = SDL_CutEvent(spot); + 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); } - SDL_UnlockMutex(SDL_EventQ.lock); } Uint8 @@ -507,7 +599,7 @@ SDL_RegisterEvents(int numevents) { Uint32 event_base; - if (SDL_userevents+numevents <= SDL_LASTEVENT) { + if ((numevents > 0) && (SDL_userevents+numevents <= SDL_LASTEVENT)) { event_base = SDL_userevents; SDL_userevents += numevents; } else { @@ -516,8 +608,20 @@ SDL_RegisterEvents(int numevents) return event_base; } -/* This is a generic event handler. - */ +int +SDL_SendAppEvent(SDL_EventType eventType) +{ + int posted; + + posted = 0; + if (SDL_GetEventState(eventType) == SDL_ENABLE) { + SDL_Event event; + event.type = eventType; + posted = (SDL_PushEvent(&event) > 0); + } + return (posted); +} + int SDL_SendSysWMEvent(SDL_SysWMmsg * message) { diff --git a/src/events/SDL_events_c.h b/src/events/SDL_events_c.h index 7d6ab3b19..f365ee3ed 100644 --- a/src/events/SDL_events_c.h +++ b/src/events/SDL_events_c.h @@ -36,6 +36,7 @@ extern int SDL_StartEventLoop(void); extern void SDL_StopEventLoop(void); extern void SDL_QuitInterrupt(void); +extern int SDL_SendAppEvent(SDL_EventType eventType); extern int SDL_SendSysWMEvent(SDL_SysWMmsg * message); extern int SDL_QuitInit(void); diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c index a56aa3e55..e987fcfbf 100644 --- a/src/events/SDL_gesture.c +++ b/src/events/SDL_gesture.c @@ -11,11 +11,11 @@ freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. + misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ @@ -35,13 +35,10 @@ #include #include -//TODO: Replace with malloc +/* TODO: Replace with malloc */ #define MAXPATHSIZE 1024 - - - #define DOLLARNPOINTS 64 #define DOLLARSIZE 256 @@ -394,11 +391,12 @@ static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points) static float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_GestureTouch* touch) { - SDL_FloatPoint points[DOLLARNPOINTS]; int i; float bestDiff = 10000; + SDL_memset(points, 0, sizeof(points)); + dollarNormalize(path,points); //PrintPath(points); diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 3454bf8bb..a3ed16869 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -774,7 +774,6 @@ SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode) event.key.keysym.scancode = scancode; event.key.keysym.sym = keyboard->keymap[scancode]; event.key.keysym.mod = modstate; - event.key.keysym.unicode = 0; event.key.windowID = keyboard->focus ? keyboard->focus->id : 0; posted = (SDL_PushEvent(&event) > 0); } @@ -829,7 +828,7 @@ SDL_KeyboardQuit(void) { } -Uint8 * +const Uint8 * SDL_GetKeyboardState(int *numkeys) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -860,7 +859,7 @@ 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; @@ -890,7 +889,7 @@ SDL_GetScancodeName(SDL_Scancode scancode) const char *name; if (scancode < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { SDL_InvalidParamError("scancode"); - return ""; + return ""; } name = SDL_scancode_names[scancode]; @@ -902,24 +901,24 @@ SDL_GetScancodeName(SDL_Scancode scancode) SDL_Scancode SDL_GetScancodeFromName(const char *name) { - int i; + int i; - if (!name || !*name) { - SDL_InvalidParamError("name"); - return SDL_SCANCODE_UNKNOWN; - } + 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; - } - } + 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; + SDL_InvalidParamError("name"); + return SDL_SCANCODE_UNKNOWN; } const char * @@ -964,51 +963,51 @@ SDL_GetKeyName(SDL_Keycode key) SDL_Keycode SDL_GetKeyFromName(const char *name) { - SDL_Keycode key; + 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)]; - } + /* 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_mouse.c b/src/events/SDL_mouse.c index d467d0791..e9404f057 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -33,6 +33,8 @@ /* 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 @@ -154,27 +156,39 @@ SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate) #endif if (window == mouse->focus) { #ifdef DEBUG_MOUSE - printf("Mouse left window, synthesizing focus lost event\n"); + 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) { - mouse->last_x = x; - mouse->last_y = y; - #ifdef DEBUG_MOUSE - printf("Mouse entered window, synthesizing focus gain event\n"); + printf("Mouse entered window, synthesizing focus gain & move event\n"); #endif - SDL_SetMouseFocus(window); + SDL_SetMouseFocus(window); + SDL_PrivateSendMouseMotion(window, mouse->mouseID, 0, x, y); } return SDL_TRUE; } int SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y) +{ + 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); +} + +static int +SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y) { SDL_Mouse *mouse = SDL_GetMouse(); int posted; @@ -182,12 +196,6 @@ SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int int yrel; int x_max = 0, y_max = 0; - if (window && !relative) { - if (!SDL_UpdateMouseFocus(window, x, y, mouse->buttonstate)) { - return 0; - } - } - /* relative motion is calculated regarding the system cursor last position */ if (relative) { xrel = x; @@ -353,6 +361,23 @@ SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y) 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 @@ -389,12 +414,12 @@ 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 ( window == NULL ) + window = mouse->focus; + + if ( window == NULL ) + return; if (mouse->WarpMouse) { mouse->WarpMouse(window, x, y); @@ -407,6 +432,8 @@ 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; @@ -416,6 +443,14 @@ SDL_SetRelativeMouseMode(SDL_bool enabled) 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; } @@ -425,8 +460,8 @@ SDL_SetRelativeMouseMode(SDL_bool enabled) if (enabled) { /* Save the expected mouse position */ - mouse->original_x = mouse->x; - mouse->original_y = mouse->y; + 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); @@ -554,13 +589,13 @@ SDL_CreateSystemCursor(SDL_SystemCursor id) return NULL; } - cursor = mouse->CreateSystemCursor(id); + cursor = mouse->CreateSystemCursor(id); if (cursor) { cursor->next = mouse->cursors; mouse->cursors = cursor; } - return cursor; + return cursor; } /* SDL_SetCursor(NULL) can be used to force the cursor redraw, @@ -618,6 +653,17 @@ SDL_GetCursor(void) 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) { diff --git a/src/events/SDL_mouse_c.h b/src/events/SDL_mouse_c.h index 7cb13cb3d..a8faa2e17 100644 --- a/src/events/SDL_mouse_c.h +++ b/src/events/SDL_mouse_c.h @@ -39,7 +39,7 @@ typedef struct SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y); /* Create a system cursor */ - SDL_Cursor *(*CreateSystemCursor) (SDL_SystemCursor id); + SDL_Cursor *(*CreateSystemCursor) (SDL_SystemCursor id); /* Show the specified cursor, or hide if cursor is NULL */ int (*ShowCursor) (SDL_Cursor * cursor); @@ -73,6 +73,9 @@ typedef struct SDL_Cursor *def_cursor; SDL_Cursor *cur_cursor; SDL_bool cursor_shown; + + /* Driver-dependent data. */ + void *driverdata; } SDL_Mouse; diff --git a/src/events/SDL_quit.c b/src/events/SDL_quit.c index 8c1dcf574..5e9f8ad85 100644 --- a/src/events/SDL_quit.c +++ b/src/events/SDL_quit.c @@ -114,15 +114,7 @@ SDL_QuitQuit(void) int SDL_SendQuit(void) { - int posted; - - posted = 0; - if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) { - SDL_Event event; - event.type = SDL_QUIT; - posted = (SDL_PushEvent(&event) > 0); - } - return (posted); + return SDL_SendAppEvent(SDL_QUIT); } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_sysevents.h b/src/events/SDL_sysevents.h index 88df0ea09..c2f1e097b 100644 --- a/src/events/SDL_sysevents.h +++ b/src/events/SDL_sysevents.h @@ -24,7 +24,8 @@ /* 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 diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c index c2bb22ece..3429b57d7 100644 --- a/src/events/SDL_touch.c +++ b/src/events/SDL_touch.c @@ -39,7 +39,7 @@ SDL_TouchInit(void) } int -SDL_GetNumTouchDevices() +SDL_GetNumTouchDevices(void) { return SDL_num_touch; } @@ -165,7 +165,7 @@ SDL_AddTouch(SDL_TouchID touchID, const char *name) return index; } -static int +static int SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure) { SDL_Finger *finger; @@ -258,7 +258,7 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, event.tfinger.touchId = id; event.tfinger.fingerId = fingerid; /* I don't trust the coordinates passed on fingerUp */ - event.tfinger.x = finger->x; + event.tfinger.x = finger->x; event.tfinger.y = finger->y; event.tfinger.dx = 0; event.tfinger.dy = 0; @@ -287,7 +287,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, finger = SDL_GetFinger(touch,fingerid); if (!finger) { - return SDL_SendTouch(id, fingerid, SDL_TRUE, x, y, pressure); + return SDL_SendTouch(id, fingerid, SDL_TRUE, x, y, pressure); } xrel = x - finger->x; @@ -306,7 +306,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, finger->x = x; finger->y = y; finger->pressure = pressure; - + /* Post the event, if desired */ posted = 0; if (SDL_GetEventState(SDL_FINGERMOTION) == SDL_ENABLE) { @@ -317,7 +317,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, event.tfinger.x = x; event.tfinger.y = y; event.tfinger.dx = xrel; - event.tfinger.dy = yrel; + event.tfinger.dy = yrel; event.tfinger.pressure = pressure; posted = (SDL_PushEvent(&event) > 0); } diff --git a/src/events/SDL_touch_c.h b/src/events/SDL_touch_c.h index 8961d74e5..d0a2cf2f7 100644 --- a/src/events/SDL_touch_c.h +++ b/src/events/SDL_touch_c.h @@ -38,17 +38,17 @@ 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); +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); + float x, float y, float pressure); /* Remove a touch */ extern void SDL_DelTouch(SDL_TouchID id); diff --git a/src/events/SDL_windowevents.c b/src/events/SDL_windowevents.c index 0e8c27c77..9011f68e1 100644 --- a/src/events/SDL_windowevents.c +++ b/src/events/SDL_windowevents.c @@ -148,12 +148,14 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1, 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) { @@ -194,13 +196,13 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1, 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(); - } - } + + 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); } diff --git a/src/events/blank_cursor.h b/src/events/blank_cursor.h index 534d2e2d2..6efb4741e 100644 --- a/src/events/blank_cursor.h +++ b/src/events/blank_cursor.h @@ -19,13 +19,13 @@ 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 +#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 }; diff --git a/src/events/default_cursor.h b/src/events/default_cursor.h index 8a7b2a9e3..8c2dcfcff 100644 --- a/src/events/default_cursor.h +++ b/src/events/default_cursor.h @@ -19,13 +19,13 @@ 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 +#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 diff --git a/src/events/scancodes_darwin.h b/src/events/scancodes_darwin.h index 1935c16e4..77c728bc7 100644 --- a/src/events/scancodes_darwin.h +++ b/src/events/scancodes_darwin.h @@ -91,7 +91,7 @@ static const SDL_Scancode darwin_scancode_table[] = { /* 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_UNKNOWN, /* unknown (unused?) */ + /* 64 */ SDL_SCANCODE_F17, /* 65 */ SDL_SCANCODE_KP_PERIOD, /* 66 */ SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */ /* 67 */ SDL_SCANCODE_KP_MULTIPLY, @@ -106,8 +106,8 @@ static const SDL_Scancode darwin_scancode_table[] = { /* 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_UNKNOWN, /* unknown (unused?) */ - /* 80 */ SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */ + /* 79 */ SDL_SCANCODE_F18, + /* 80 */ SDL_SCANCODE_F19, /* 81 */ SDL_SCANCODE_KP_EQUALS, /* 82 */ SDL_SCANCODE_KP_0, /* 83 */ SDL_SCANCODE_KP_1, diff --git a/src/events/scancodes_windows.h b/src/events/scancodes_windows.h index 7bf69b0ad..1034b1b57 100644 --- a/src/events/scancodes_windows.h +++ b/src/events/scancodes_windows.h @@ -21,6 +21,8 @@ #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[] = { @@ -36,18 +38,18 @@ static const SDL_Scancode windows_scancode_table[] = 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_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_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_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, // 6 + 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 + 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 index bf958a685..fadcfbfd9 100644 --- a/src/events/scancodes_xfree86.h +++ b/src/events/scancodes_xfree86.h @@ -141,8 +141,8 @@ static const SDL_Scancode xfree86_scancode_table[] = { /* 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 */ + /* 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, @@ -298,7 +298,7 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 118 */ SDL_SCANCODE_UNKNOWN, /* plusminus */ /* 119 */ SDL_SCANCODE_PAUSE, /* 120 */ SDL_SCANCODE_UNKNOWN, /* XF86LaunchA */ - /* 121 */ SDL_SCANCODE_UNKNOWN, /* KP_Decimal */ + /* 121 */ SDL_SCANCODE_UNKNOWN, /* KP_Decimal */ /* 122 */ SDL_SCANCODE_UNKNOWN, /* Hangul */ /* 123 */ SDL_SCANCODE_UNKNOWN, /* Hangul_Hanja */ /* 124 */ SDL_SCANCODE_UNKNOWN, @@ -325,15 +325,15 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 145 */ SDL_SCANCODE_UNKNOWN, /* XF86Send */ /* 146 */ SDL_SCANCODE_UNKNOWN, /* 147 */ SDL_SCANCODE_UNKNOWN, /* XF86Xfer */ - /* 148 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch1 */ - /* 149 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch2 */ + /* 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_UNKNOWN, /* XF86Favorites */ + /* 156 */ SDL_SCANCODE_AC_BOOKMARKS, /* XF86Favorites */ /* 157 */ SDL_SCANCODE_COMPUTER, /* 158 */ SDL_SCANCODE_AC_BACK, /* 159 */ SDL_SCANCODE_AC_FORWARD, @@ -348,7 +348,7 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 168 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioRewind */ /* 169 */ SDL_SCANCODE_UNKNOWN, /* XF86Phone */ /* 170 */ SDL_SCANCODE_UNKNOWN, - /* 171 */ SDL_SCANCODE_UNKNOWN, /* XF86Tools */ + /* 171 */ SDL_SCANCODE_F13, /* XF86Tools */ /* 172 */ SDL_SCANCODE_AC_HOME, /* 173 */ SDL_SCANCODE_AC_REFRESH, /* 174 */ SDL_SCANCODE_UNKNOWN, /* XF86Close */ @@ -360,13 +360,13 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 180 */ SDL_SCANCODE_UNKNOWN, /* parenright */ /* 181 */ SDL_SCANCODE_UNKNOWN, /* XF86New */ /* 182 */ SDL_SCANCODE_AGAIN, - /* 183 */ SDL_SCANCODE_UNKNOWN, /* XF86Tools */ - /* 184 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch5 */ - /* 185 */ SDL_SCANCODE_UNKNOWN, /* XF86MenuKB */ - /* 186 */ SDL_SCANCODE_UNKNOWN, - /* 187 */ SDL_SCANCODE_UNKNOWN, - /* 188 */ SDL_SCANCODE_UNKNOWN, - /* 189 */ SDL_SCANCODE_UNKNOWN, + /* 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 */ diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index 5c3ae543f..3a6f7db66 100644 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -1,763 +1,764 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2013 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 - data sources. It can easily be extended to files, memory, etc. -*/ - -#include "SDL_endian.h" -#include "SDL_rwops.h" - -#ifdef __APPLE__ -#include "cocoa/SDL_rwopsbundlesupport.h" -#endif /* __APPLE__ */ - -#ifdef ANDROID -#include "../core/android/SDL_android.h" -#endif - -#ifdef __WIN32__ - -/* Functions to read/write Win32 API file pointers */ - -#include "../core/windows/SDL_windows.h" - -#ifndef INVALID_SET_FILE_POINTER -#define INVALID_SET_FILE_POINTER 0xFFFFFFFF -#endif - -#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); - - 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) -{ - 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.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; - } - - if (total_need < READAHEAD_BUFFER_SIZE) { - 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.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.windowsio.h, ptr, (DWORD)total_need, &byte_read, NULL)) { - SDL_Error(SDL_EFREAD); - return 0; - } - total_read += byte_read; - } - 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__ */ - -#ifdef HAVE_STDIO_H - -/* Functions to read/write stdio file pointers */ - -static Sint64 SDLCALL -stdio_size(SDL_RWops * context) -{ - 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); - } -#elif defined(HAVE__FSEEKI64) - if (_fseeki64(context->hidden.stdio.fp, offset, whence) == 0) { - return _ftelli64(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 size_t SDLCALL -stdio_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) -{ - 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); -} - -static size_t SDLCALL -stdio_write(SDL_RWops * context, const void *ptr, size_t size, size_t num) -{ - 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); -} - -static int SDLCALL -stdio_close(SDL_RWops * context) -{ - 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 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; - - 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 size_t SDLCALL -mem_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) -{ - 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; - } - - 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; - - return (total_bytes / size); -} - -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); -} - -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 (0); -} - -static int SDLCALL -mem_close(SDL_RWops * context) -{ - if (context) { - SDL_FreeRW(context); - } - return (0); -} - - -/* Functions to create SDL_RWops structures from various data sources */ - -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 - /* 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 */ - - /* 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; - -#elif HAVE_STDIO_H - { - #ifdef __APPLE__ - FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode); - #elif __WINRT__ - FILE *fp = NULL; - fopen_s(&fp, 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"); -#endif /* !HAVE_STDIO_H */ - - return (rwops); -} - -#ifdef HAVE_STDIO_H -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_SetError("SDL not compiled with stdio support"); - return NULL; -} -#endif /* HAVE_STDIO_H */ - -SDL_RWops * -SDL_RWFromMem(void *mem, int size) -{ - 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->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 *rwops = NULL; - if (!mem) { - SDL_InvalidParamError("mem"); - return (rwops); - } - if (!size) { - SDL_InvalidParamError("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 *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) -{ - SDL_free(area); -} - -/* Functions for dynamically reading and writing endian-specific values */ - -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 = 0; - - SDL_RWread(src, &value, (sizeof value), 1); - return (SDL_SwapLE16(value)); -} - -Uint16 -SDL_ReadBE16(SDL_RWops * src) -{ - Uint16 value = 0; - - SDL_RWread(src, &value, (sizeof value), 1); - return (SDL_SwapBE16(value)); -} - -Uint32 -SDL_ReadLE32(SDL_RWops * src) -{ - Uint32 value = 0; - - SDL_RWread(src, &value, (sizeof value), 1); - return (SDL_SwapLE32(value)); -} - -Uint32 -SDL_ReadBE32(SDL_RWops * src) -{ - Uint32 value = 0; - - SDL_RWread(src, &value, (sizeof value), 1); - return (SDL_SwapBE32(value)); -} - -Uint64 -SDL_ReadLE64(SDL_RWops * src) -{ - Uint64 value = 0; - - SDL_RWread(src, &value, (sizeof value), 1); - return (SDL_SwapLE64(value)); -} - -Uint64 -SDL_ReadBE64(SDL_RWops * src) -{ - Uint64 value = 0; - - SDL_RWread(src, &value, (sizeof value), 1); - return (SDL_SwapBE64(value)); -} - -size_t -SDL_WriteU8(SDL_RWops * dst, Uint8 value) -{ - return (SDL_RWwrite(dst, &value, (sizeof value), 1)); -} - -size_t -SDL_WriteLE16(SDL_RWops * dst, Uint16 value) -{ - value = SDL_SwapLE16(value); - return (SDL_RWwrite(dst, &value, (sizeof value), 1)); -} - -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)); -} - -size_t -SDL_WriteBE32(SDL_RWops * dst, Uint32 value) -{ - value = SDL_SwapBE32(value); - return (SDL_RWwrite(dst, &value, (sizeof value), 1)); -} - -size_t -SDL_WriteLE64(SDL_RWops * dst, Uint64 value) -{ - value = SDL_SwapLE64(value); - return (SDL_RWwrite(dst, &value, (sizeof value), 1)); -} - -size_t -SDL_WriteBE64(SDL_RWops * dst, Uint64 value) -{ - value = SDL_SwapBE64(value); - return (SDL_RWwrite(dst, &value, (sizeof value), 1)); -} - -/* vi: set ts=4 sw=4 expandtab: */ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as 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 + data sources. It can easily be extended to files, memory, etc. +*/ + +#include "SDL_endian.h" +#include "SDL_rwops.h" + +#ifdef __APPLE__ +#include "cocoa/SDL_rwopsbundlesupport.h" +#endif /* __APPLE__ */ + +#ifdef ANDROID +#include "../core/android/SDL_android.h" +#include "SDL_system.h" +#endif + +#ifdef __WIN32__ + +/* Functions to read/write Win32 API file pointers */ + +#include "../core/windows/SDL_windows.h" + +#ifndef INVALID_SET_FILE_POINTER +#define INVALID_SET_FILE_POINTER 0xFFFFFFFF +#endif + +#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); + + 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) +{ + 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.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; + } + + if (total_need < READAHEAD_BUFFER_SIZE) { + 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.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.windowsio.h, ptr, (DWORD)total_need, &byte_read, NULL)) { + SDL_Error(SDL_EFREAD); + return 0; + } + total_read += byte_read; + } + 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__ */ + +#ifdef HAVE_STDIO_H + +/* Functions to read/write stdio file pointers */ + +static Sint64 SDLCALL +stdio_size(SDL_RWops * context) +{ + 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); + } +#elif defined(HAVE__FSEEKI64) + if (_fseeki64(context->hidden.stdio.fp, offset, whence) == 0) { + return _ftelli64(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 size_t SDLCALL +stdio_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) +{ + 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); +} + +static size_t SDLCALL +stdio_write(SDL_RWops * context, const void *ptr, size_t size, size_t num) +{ + 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); +} + +static int SDLCALL +stdio_close(SDL_RWops * context) +{ + 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 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; + + 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 size_t SDLCALL +mem_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) +{ + 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; + } + + 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; + + return (total_bytes / size); +} + +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); +} + +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 (0); +} + +static int SDLCALL +mem_close(SDL_RWops * context) +{ + if (context) { + SDL_FreeRW(context); + } + return (0); +} + + +/* Functions to create SDL_RWops structures from various data sources */ + +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 + /* 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 */ + + /* 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; + +#elif HAVE_STDIO_H + { + #ifdef __APPLE__ + FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode); + #elif __WINRT__ + FILE *fp = NULL; + fopen_s(&fp, 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"); +#endif /* !HAVE_STDIO_H */ + + return (rwops); +} + +#ifdef HAVE_STDIO_H +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_SetError("SDL not compiled with stdio support"); + return NULL; +} +#endif /* HAVE_STDIO_H */ + +SDL_RWops * +SDL_RWFromMem(void *mem, int size) +{ + 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->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 *rwops = NULL; + if (!mem) { + SDL_InvalidParamError("mem"); + return (rwops); + } + if (!size) { + SDL_InvalidParamError("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 *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) +{ + SDL_free(area); +} + +/* Functions for dynamically reading and writing endian-specific values */ + +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 = 0; + + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapLE16(value)); +} + +Uint16 +SDL_ReadBE16(SDL_RWops * src) +{ + Uint16 value = 0; + + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapBE16(value)); +} + +Uint32 +SDL_ReadLE32(SDL_RWops * src) +{ + Uint32 value = 0; + + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapLE32(value)); +} + +Uint32 +SDL_ReadBE32(SDL_RWops * src) +{ + Uint32 value = 0; + + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapBE32(value)); +} + +Uint64 +SDL_ReadLE64(SDL_RWops * src) +{ + Uint64 value = 0; + + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapLE64(value)); +} + +Uint64 +SDL_ReadBE64(SDL_RWops * src) +{ + Uint64 value = 0; + + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapBE64(value)); +} + +size_t +SDL_WriteU8(SDL_RWops * dst, Uint8 value) +{ + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); +} + +size_t +SDL_WriteLE16(SDL_RWops * dst, Uint16 value) +{ + value = SDL_SwapLE16(value); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); +} + +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)); +} + +size_t +SDL_WriteBE32(SDL_RWops * dst, Uint32 value) +{ + value = SDL_SwapBE32(value); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); +} + +size_t +SDL_WriteLE64(SDL_RWops * dst, Uint64 value) +{ + value = SDL_SwapLE64(value); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); +} + +size_t +SDL_WriteBE64(SDL_RWops * dst, Uint64 value) +{ + 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.m b/src/file/cocoa/SDL_rwopsbundlesupport.m index 39b4c0e9c..8ec0220ec 100644 --- a/src/file/cocoa/SDL_rwopsbundlesupport.m +++ b/src/file/cocoa/SDL_rwopsbundlesupport.m @@ -14,32 +14,32 @@ 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); - } + /* 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]; + NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init]; - NSFileManager* file_manager = [NSFileManager defaultManager]; - NSString* resource_path = [[NSBundle mainBundle] resourcePath]; + NSFileManager* file_manager = [NSFileManager defaultManager]; + NSString* resource_path = [[NSBundle mainBundle] resourcePath]; - NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)]; + 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); - } + 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]; + [autorelease_pool drain]; - return fp; + return fp; } #endif diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index 5952a455d..d7e1c5062 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -23,7 +23,7 @@ #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; @@ -149,18 +149,23 @@ SDL_HapticOpen(int device_index) 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); - /* Add haptic to list */ - ++haptic->ref_count; - for (i = 0; SDL_haptics[i]; i++) - /* Skip to next haptic */ ; - SDL_haptics[i] = haptic; - return haptic; } @@ -173,6 +178,13 @@ 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) { @@ -262,6 +274,13 @@ 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."); @@ -299,10 +318,15 @@ SDL_HapticOpenFromJoystick(SDL_Joystick * joystick) } /* Add haptic to list */ - ++haptic->ref_count; 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; } @@ -397,7 +421,7 @@ unsigned int SDL_HapticQuery(SDL_Haptic * haptic) { if (!ValidHaptic(haptic)) { - return -1; + return 0; /* same as if no effects were supported */ } return haptic->supported; @@ -699,32 +723,18 @@ SDL_HapticStopAll(SDL_Haptic * haptic) return SDL_SYS_HapticStopAll(haptic); } -static void -SDL_HapticRumbleCreate(SDL_HapticEffect * efx) -{ - SDL_memset(efx, 0, sizeof(SDL_HapticEffect)); - 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; -} - /* * Checks to see if rumble is supported. */ int SDL_HapticRumbleSupported(SDL_Haptic * haptic) { - SDL_HapticEffect efx; - if (!ValidHaptic(haptic)) { return -1; } - SDL_HapticRumbleCreate(&efx); - return SDL_HapticEffectSupported(haptic, &efx); + /* Most things can use SINE, but XInput only has LEFTRIGHT. */ + return ((haptic->supported & (SDL_HAPTIC_SINE|SDL_HAPTIC_LEFTRIGHT)) != 0); } /* @@ -733,6 +743,8 @@ SDL_HapticRumbleSupported(SDL_Haptic * haptic) int SDL_HapticRumbleInit(SDL_Haptic * haptic) { + SDL_HapticEffect *efx = &haptic->rumble_effect; + if (!ValidHaptic(haptic)) { return -1; } @@ -742,8 +754,23 @@ SDL_HapticRumbleInit(SDL_Haptic * haptic) return 0; } - /* Copy over. */ - SDL_HapticRumbleCreate(&haptic->rumble_effect); + 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; @@ -757,7 +784,8 @@ SDL_HapticRumbleInit(SDL_Haptic * haptic) int SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length) { - SDL_HapticPeriodic *efx; + SDL_HapticEffect *efx; + Sint16 magnitude; if (!ValidHaptic(haptic)) { return -1; @@ -770,16 +798,25 @@ SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length) /* Clamp strength. */ if (strength > 1.0f) { strength = 1.0f; - } - else if (strength < 0.0f) { + } else if (strength < 0.0f) { strength = 0.0f; } + magnitude = (Sint16)(32767.0f*strength); - /* New effect. */ - efx = &haptic->rumble_effect.periodic; - efx->magnitude = (Sint16)(32767.0f*strength); - efx->length = length; - SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect); + 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); } @@ -801,4 +838,3 @@ SDL_HapticRumbleStop(SDL_Haptic * haptic) return SDL_HapticStopEffect(haptic, haptic->rumble_id); } - diff --git a/src/haptic/SDL_syshaptic.h b/src/haptic/SDL_syshaptic.h index affd5731f..ac5198ffd 100644 --- a/src/haptic/SDL_syshaptic.h +++ b/src/haptic/SDL_syshaptic.h @@ -56,10 +56,10 @@ struct _SDL_Haptic SDL_HapticEffect rumble_effect; /* Rumble effect. */ }; -/* +/* * Scans the system for haptic devices. * - * Returns 0 on success, -1 on error. + * Returns number of devices on success, -1 on error. */ extern int SDL_SYS_HapticInit(void); diff --git a/src/haptic/darwin/SDL_syshaptic.c b/src/haptic/darwin/SDL_syshaptic.c index 1af86b8b1..ec889041c 100644 --- a/src/haptic/darwin/SDL_syshaptic.c +++ b/src/haptic/darwin/SDL_syshaptic.c @@ -35,7 +35,7 @@ #include #ifndef IO_OBJECT_NULL -#define IO_OBJECT_NULL ((io_service_t)0) +#define IO_OBJECT_NULL ((io_service_t)0) #endif #define MAX_HAPTICS 32 @@ -49,7 +49,7 @@ 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 assosciated with it. */ + SDL_Haptic *haptic; /* Haptic currently associated with it. */ /* Usage pages for determining if it's a mouse or not. */ long usage; @@ -83,7 +83,7 @@ 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 * @@ -259,7 +259,7 @@ HIDGetDeviceProduct(io_service_t dev, char *name) } /* 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 + * get dictionary for USB properties: step up two levels and get CF dictionary for USB properties */ if ((KERN_SUCCESS == IORegistryEntryGetParentEntry(dev, kIOServicePlane, &parent1)) @@ -272,7 +272,7 @@ HIDGetDeviceProduct(io_service_t dev, char *name) if (usbProperties) { CFTypeRef refCF = 0; /* get device info - * try hid dictionary first, if fail then go to usb dictionary + * try hid dictionary first, if fail then go to USB dictionary */ @@ -342,7 +342,8 @@ GetSupportedFeatures(SDL_Haptic * haptic) /* Test for effects. */ FF_TEST(FFCAP_ET_CONSTANTFORCE, SDL_HAPTIC_CONSTANT); FF_TEST(FFCAP_ET_RAMPFORCE, SDL_HAPTIC_RAMP); - FF_TEST(FFCAP_ET_SQUARE, SDL_HAPTIC_SQUARE); + /* !!! 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); @@ -562,7 +563,7 @@ SDL_SYS_HapticClose(SDL_Haptic * haptic) } -/* +/* * Clean up after system specific haptic stuff */ void @@ -708,7 +709,7 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, } - /* The big type handling switch, even bigger then linux's version. */ + /* The big type handling switch, even bigger then Linux's version. */ switch (src->type) { case SDL_HAPTIC_CONSTANT: hap_constant = &src->constant; @@ -750,7 +751,8 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, break; case SDL_HAPTIC_SINE: - case SDL_HAPTIC_SQUARE: + /* !!! 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: @@ -978,8 +980,9 @@ SDL_SYS_HapticEffectType(Uint16 type) case SDL_HAPTIC_RAMP: return kFFEffectType_RampForce_ID; - case SDL_HAPTIC_SQUARE: - return kFFEffectType_Square_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; diff --git a/src/haptic/dummy/SDL_syshaptic.c b/src/haptic/dummy/SDL_syshaptic.c index c34081968..29084eb17 100644 --- a/src/haptic/dummy/SDL_syshaptic.c +++ b/src/haptic/dummy/SDL_syshaptic.c @@ -29,8 +29,7 @@ static int SDL_SYS_LogicError(void) { - SDL_SetError("Logic error: No haptic devices available."); - return 0; + return SDL_SetError("Logic error: No haptic devices available."); } @@ -52,8 +51,7 @@ SDL_SYS_HapticName(int index) int SDL_SYS_HapticOpen(SDL_Haptic * haptic) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } @@ -74,8 +72,7 @@ SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } @@ -104,8 +101,7 @@ int SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } @@ -114,8 +110,7 @@ SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } @@ -123,16 +118,14 @@ int SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } int SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } @@ -148,47 +141,39 @@ int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } int SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } int SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } int SDL_SYS_HapticPause(SDL_Haptic * haptic) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } int SDL_SYS_HapticUnpause(SDL_Haptic * haptic) { - SDL_SYS_LogicError(); - return -1; + return SDL_SYS_LogicError(); } int SDL_SYS_HapticStopAll(SDL_Haptic * haptic) { - SDL_SYS_LogicError(); - return -1; + 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 index e07c832f9..ad34fc27f 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -99,7 +99,8 @@ EV_IsHaptic(int fd) /* Convert supported features to SDL_HAPTIC platform-neutral features. */ EV_TEST(FF_CONSTANT, SDL_HAPTIC_CONSTANT); EV_TEST(FF_SINE, SDL_HAPTIC_SINE); - EV_TEST(FF_SQUARE, SDL_HAPTIC_SQUARE); + /* !!! 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); @@ -111,6 +112,7 @@ EV_IsHaptic(int fd) 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; @@ -155,7 +157,7 @@ SDL_SYS_HapticInit(void) numhaptics = 0; - /* + /* * Limit amount of checks to MAX_HAPTICS since we may or may not have * permission to some or all devices. */ @@ -371,7 +373,7 @@ SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) int SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) { - /* We are assuming linux is using evdev which should trump the old + /* 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; @@ -446,7 +448,7 @@ SDL_SYS_HapticClose(SDL_Haptic * haptic) } -/* +/* * Clean up after system specific haptic stuff */ void @@ -498,44 +500,44 @@ SDL_SYS_ToDirection(SDL_HapticDirection * dir) 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] + (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] + 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] + /* + 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: @@ -548,7 +550,7 @@ SDL_SYS_ToDirection(SDL_HapticDirection * dir) #define CLAMP(x) (((x) > 32767) ? 32767 : x) /* - * Initializes the linux effect struct from a haptic_effect. + * Initializes the Linux effect struct from a haptic_effect. * Values above 32767 (for unsigned) are unspecified so we must clamp. */ static int @@ -559,6 +561,7 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) SDL_HapticPeriodic *periodic; SDL_HapticCondition *condition; SDL_HapticRamp *ramp; + SDL_HapticLeftRight *leftright; /* Clear up */ SDL_memset(dest, 0, sizeof(struct ff_effect)); @@ -596,7 +599,8 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) break; case SDL_HAPTIC_SINE: - case SDL_HAPTIC_SQUARE: + /* !!! 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: @@ -620,8 +624,9 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) /* Periodic */ if (periodic->type == SDL_HAPTIC_SINE) dest->u.periodic.waveform = FF_SINE; - else if (periodic->type == SDL_HAPTIC_SQUARE) - dest->u.periodic.waveform = FF_SQUARE; + /* !!! 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) @@ -725,6 +730,27 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) 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."); diff --git a/src/haptic/windows/SDL_syshaptic.c b/src/haptic/windows/SDL_syshaptic.c index 9446ce52a..9b1349644 100644 --- a/src/haptic/windows/SDL_syshaptic.c +++ b/src/haptic/windows/SDL_syshaptic.c @@ -23,6 +23,9 @@ #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" @@ -41,8 +44,8 @@ static struct char *name; SDL_Haptic *haptic; DIDEVCAPS capabilities; - Uint8 bXInputHaptic; // Supports force feedback via XInput. - Uint8 userid; // XInput userid index for this joystick + Uint8 bXInputHaptic; /* Supports force feedback via XInput. */ + Uint8 userid; /* XInput userid index for this joystick */ } SDL_hapticlist[MAX_HAPTICS]; @@ -53,9 +56,13 @@ struct haptic_hwdata { LPDIRECTINPUTDEVICE8 device; DWORD axes[3]; /* Axes to use. */ - int is_joystick; /* Device is loaded as joystick. */ - Uint8 bXInputHaptic; // Supports force feedback via XInput. - Uint8 userid; // XInput userid index for this joystick + 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; }; @@ -92,7 +99,8 @@ 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); + 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, @@ -101,13 +109,15 @@ 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 @@ -293,7 +303,8 @@ DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv) EFFECT_TEST(GUID_ConstantForce, SDL_HAPTIC_CONSTANT); EFFECT_TEST(GUID_CustomForce, SDL_HAPTIC_CUSTOM); EFFECT_TEST(GUID_Sine, SDL_HAPTIC_SINE); - EFFECT_TEST(GUID_Square, SDL_HAPTIC_SQUARE); + /* !!! 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); @@ -342,61 +353,44 @@ SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, DIDEVICEINSTANCE instance) HRESULT ret; int ret2; LPDIRECTINPUTDEVICE8 device; - - /* 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)); + LPDIRECTINPUTDEVICE8 device8; /* Open the device */ ret = IDirectInput8_CreateDevice(dinput, &instance.guidInstance, &device, NULL); if (FAILED(ret)) { DI_SetError("Creating DirectInput device", ret); - goto creat_err; + return -1; } /* Now get the IDirectInputDevice8 interface, instead. */ ret = IDirectInputDevice8_QueryInterface(device, &IID_IDirectInputDevice8, - (LPVOID *) & haptic->hwdata-> - device); + (LPVOID *) &device8); /* Done with the temporary one now. */ IDirectInputDevice8_Release(device); if (FAILED(ret)) { DI_SetError("Querying DirectInput interface", ret); - goto creat_err; + return -1; } - ret2 = SDL_SYS_HapticOpenFromDevice8(haptic, haptic->hwdata->device); + ret2 = SDL_SYS_HapticOpenFromDevice8(haptic, device8, SDL_FALSE); if (ret2 < 0) { - goto query_err; + IDirectInputDevice8_Release(device8); + return -1; } return 0; - - query_err: - IDirectInputDevice8_Release(haptic->hwdata->device); - creat_err: - if (haptic->hwdata != NULL) { - SDL_free(haptic->hwdata); - haptic->hwdata = NULL; - } - return -1; } 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); - /* !!! FIXME: we can probably do more than SINE if we figure out how to set up the left and right motors properly. */ - haptic->supported = SDL_HAPTIC_SINE; + haptic->supported = SDL_HAPTIC_LEFTRIGHT; haptic->neffects = 1; haptic->nplaying = 1; @@ -422,6 +416,30 @@ SDL_SYS_HapticOpenFromXInput(SDL_Haptic * haptic, Uint8 userid) 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; } @@ -433,17 +451,25 @@ SDL_SYS_HapticOpenFromXInput(SDL_Haptic * haptic, Uint8 userid) * - Set data format. * - Acquire exclusiveness. * - Reset actuators. - * - Get supported featuers. + * - Get supported features. */ static int SDL_SYS_HapticOpenFromDevice8(SDL_Haptic * haptic, - LPDIRECTINPUTDEVICE8 device8) + 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, @@ -645,7 +671,7 @@ SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) { - int i, ret; + int i; HRESULT idret; DIDEVICEINSTANCE joy_instance; joy_instance.dwSize = sizeof(DIDEVICEINSTANCE); @@ -657,49 +683,24 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) if ((SDL_hapticlist[i].bXInputHaptic) && (SDL_hapticlist[i].userid == userid)) { SDL_assert(joystick->hwdata->bXInputHaptic); haptic->index = i; - break; + return SDL_SYS_HapticOpenFromXInput(haptic, SDL_hapticlist[haptic->index].userid); } } } else { for (i=0; ihwdata->InputDevice, - &joy_instance); + idret = IDirectInputDevice8_GetDeviceInfo(joystick->hwdata->InputDevice, &joy_instance); if (FAILED(idret)) { return -1; } if (DI_GUIDIsSame(&SDL_hapticlist[i].instance.guidInstance, &joy_instance.guidInstance)) { haptic->index = i; - break; + return SDL_SYS_HapticOpenFromDevice8(haptic, joystick->hwdata->InputDevice, SDL_TRUE); } } } - if (i >= SDL_numhaptics) { - return -1; - } - - /* 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)); - - /* Now open the device. */ - if (!joystick->hwdata->bXInputHaptic) { - ret = SDL_SYS_HapticOpenFromDevice8(haptic, joystick->hwdata->InputDevice); - if (ret < 0) { - return -1; - } - } - - /* It's using the joystick device. */ - haptic->hwdata->is_joystick = 1; - haptic->hwdata->bXInputHaptic = joystick->hwdata->bXInputHaptic; - haptic->hwdata->userid = joystick->hwdata->userid; - - return 0; + /* No match to our haptic list */ + return -1; } @@ -717,7 +718,11 @@ SDL_SYS_HapticClose(SDL_Haptic * haptic) haptic->neffects = 0; /* Clean up */ - if (!haptic->hwdata->bXInputHaptic) { + 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) { @@ -732,7 +737,7 @@ SDL_SYS_HapticClose(SDL_Haptic * haptic) } -/* +/* * Clean up after system specific haptic stuff */ void @@ -888,7 +893,7 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, } - /* The big type handling switch, even bigger then linux's version. */ + /* The big type handling switch, even bigger then Linux's version. */ switch (src->type) { case SDL_HAPTIC_CONSTANT: hap_constant = &src->constant; @@ -930,7 +935,8 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, break; case SDL_HAPTIC_SINE: - case SDL_HAPTIC_SQUARE: + /* !!! 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: @@ -1158,8 +1164,9 @@ SDL_SYS_HapticEffectType(SDL_HapticEffect * effect) case SDL_HAPTIC_RAMP: return &GUID_RampForce; - case SDL_HAPTIC_SQUARE: - return &GUID_Square; + /* !!! 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; @@ -1205,7 +1212,7 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, HRESULT ret; REFGUID type = SDL_SYS_HapticEffectType(base); - if (type == NULL) { + if ((type == NULL) && (!haptic->hwdata->bXInputHaptic)) { goto err_hweffect; } @@ -1220,7 +1227,7 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_zerop(effect->hweffect); if (haptic->hwdata->bXInputHaptic) { - SDL_assert(base->type == SDL_HAPTIC_SINE); /* should catch this at higher level */ + SDL_assert(base->type == SDL_HAPTIC_LEFTRIGHT); /* should catch this at higher level */ return SDL_SYS_HapticUpdateEffect(haptic, effect, base); } @@ -1264,19 +1271,15 @@ SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, DIEFFECT temp; if (haptic->hwdata->bXInputHaptic) { - // !!! FIXME: this isn't close to right. We only support "sine" effects, - // !!! FIXME: we ignore most of the parameters, and we probably get - // !!! FIXME: the ones we don't ignore wrong, too. - // !!! FIXME: if I had a better understanding of how the two motors - // !!! FIXME: could be used in unison, perhaps I could implement other - // !!! FIXME: effect types? - /* From MSDN: - "Note that the right motor is the high-frequency motor, the left - motor is the low-frequency motor. They do not always need to be - set to the same amount, as they provide different effects." */ XINPUT_VIBRATION *vib = &effect->hweffect->vibration; - SDL_assert(data->type == SDL_HAPTIC_SINE); - vib->wLeftMotorSpeed = vib->wRightMotorSpeed = data->periodic.magnitude * 2; + 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; } @@ -1327,7 +1330,11 @@ SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, if (haptic->hwdata->bXInputHaptic) { XINPUT_VIBRATION *vib = &effect->hweffect->vibration; - return (XINPUTSETSTATE(haptic->hwdata->userid, vib) == ERROR_SUCCESS); + 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. */ @@ -1356,7 +1363,10 @@ SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) if (haptic->hwdata->bXInputHaptic) { XINPUT_VIBRATION vibration = { 0, 0 }; - return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS); + 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); @@ -1515,7 +1525,10 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic) if (haptic->hwdata->bXInputHaptic) { XINPUT_VIBRATION vibration = { 0, 0 }; - return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS); + 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. */ @@ -1529,4 +1542,40 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic) } +/* !!! 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/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 9bf87a30c..414e59135 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -1,1275 +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" - -#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; - - -/* default mappings we support */ -const char *s_ControllerMappings [] = -{ -#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) - "xinput,X360 Controller,a:b10,b:b11,y:b13,x:b12,start:b4,guide:b14,back:b5,dpup:b0,dpleft:b2,dpdown:b1,dpright:b3,leftshoulder:b8,rightshoulder:b9,leftstick:b6,rightstick:b7,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5", -#endif -#ifdef SDL_JOYSTICK_DINPUT - "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", - "88880803000000000000504944564944,PS3 Controller,a:b2,b:b1,x:b0,y:b3,start:b11,back:b8,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.4,dpdown:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,guide:b12", - "4c056802000000000000504944564944,PS3 Controller,a:b14,b:b13,y:b12,x:b15,start:b3,guide:b16,back:b0,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpleft:b7,dpdown:b6,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9,", - "25090500000000000000504944564944,PS3 DualShock,a:b2,b:b1,x:b0,y:b3,start:b8,guide:,back:b9,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.4,dpdown:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b4,righttrigger:b5", - "ffff0000000000000000504944564944,GameStop Gamepad,a:b0,b:b1,y:b3,x:b2,start:b9,guide:,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,", - "6d0416c2000000000000504944564944,Generic DirectInput Controller,a:b1,b:b2,y:b3,x:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,", -#elif defined(__MACOSX__) - "5e040000000000008e02000000000000,X360 Controller,a:b0,b:b1,y:b3,x:b2,start:b8,guide:b10,back:b9,dpup:b11,dpleft:b13,dpdown:b12,dpright:b14,leftshoulder:b4,rightshoulder:b5,leftstick:b6,rightstick:b7,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5", - "4c050000000000006802000000000000,PS3 Controller,a:b14,b:b13,x:b12,y:b15,start:b3,guide:b16,back:b0,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpleft:b6,dpdown:b7,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9", - "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,y:b3,x:b2,start:b9,guide:,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,", - "6d040000000000001fc2000000000000,Logitech F710 Gamepad Controller (XInput),a:b0,b:b1,y:b3,x:b2,start:b8,guide:b10,back:b9,leftstick:b6,rightstick:b7,leftshoulder:b4,rightshoulder:b5,dpup:b11,dpleft:b13,dpdown:b12,dpright:b14,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,", - "6d0400000000000016c2000000000000,Logitech F310 Gamepad Controller (DInput),a:b1,b:b2,y:b3,x:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,", // Guide button doesn't seem to be sent in DInput mode. - "6d0400000000000019c2000000000000,Logitech Wireless Gamepad Controller (DInput),a:b1,b:b2,y:b3,x:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,", // This includes F710 in DInput mode and the "Logitech Cordless RumblePad 2", at the very least. -#elif defined(__LINUX__) - "030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5", - "030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,", - "030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpleft:b11,dpdown:b14,dpright:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,", - "030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,x:b15,y:b12,start:b3,guide:b16,back:b0,leftstick:b1,rightstick:b2,leftshoulder:b10,rightshoulder:b11,dpup:b4,dpleft:b7,dpdown:b6,dpright:b5,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9", - "030000006d0400001fc2000005030000,Logitech F710 Gamepad Controller (XInput),a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,", - "030000006d04000019c2000011010000,Logitech F710 Gamepad Controller (DInput),a:b1,b:b2,y:b3,x:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,", // Guide button doesn't seem to be sent in DInput mode. - "030000006d0400001dc2000014400000,Logitech F310 Gamepad (XInput),a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,", - "030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,y:b3,x:b0,start:b9,guide:,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,", - "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,y:b3,x:b2,start:b9,guide:,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,", -#endif - NULL -}; - -static ControllerMapping_t *s_pSupportedControllers = NULL; -#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) -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 ) // simlate 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-caclulated offset to certain joystick mappings - */ -ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index) -{ -#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) - 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; -#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) - SDL_bool is_xinput_mapping = SDL_FALSE; -#endif - - pchGUID = SDL_PrivateGetControllerGUIDFromMappingString( mappingString ); - if (!pchGUID) { - return -1; - } -#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) - 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(); - } -#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) - 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 ) - { - return ( SDL_JoystickGetAxis( gamecontroller->joystick, gamecontroller->mapping.axes[axis]) ); - } - 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 axi 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: */ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as 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; +#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) +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) +{ +#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) + 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; +#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) + SDL_bool is_xinput_mapping = SDL_FALSE; +#endif + + pchGUID = SDL_PrivateGetControllerGUIDFromMappingString( mappingString ); + if (!pchGUID) { + return -1; + } +#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) + 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(); + } +#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) + 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 000000000..7f6c7b29f --- /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 6099ed176..bb8652f4d 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -22,25 +22,48 @@ /* This is the joystick API for Simple DirectMedia Layer */ +#include "SDL.h" #include "SDL_events.h" #include "SDL_sysjoystick.h" #include "SDL_assert.h" +#include "SDL_hints.h" #if !SDL_EVENTS_DISABLED #include "../events/SDL_events_c.h" #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; + /* 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; + status = 0; } return (status); } @@ -78,26 +101,26 @@ SDL_Joystick * SDL_JoystickOpen(int device_index) { SDL_Joystick *joystick; - SDL_Joystick *joysticklist; - const char *joystickname = NULL; + 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; + 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 */ @@ -113,11 +136,11 @@ SDL_JoystickOpen(int device_index) return NULL; } - joystickname = SDL_SYS_JoystickNameForDeviceIndex( device_index ); - if ( joystickname ) - joystick->name = SDL_strdup( joystickname ); - else - joystick->name = 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 @@ -159,11 +182,11 @@ SDL_JoystickOpen(int device_index) /* Add joystick to list */ ++joystick->ref_count; - /* Link the joystick in the list */ - joystick->next = SDL_joysticks; - SDL_joysticks = joystick; + /* Link the joystick in the list */ + joystick->next = SDL_joysticks; + SDL_joysticks = joystick; - SDL_SYS_JoystickUpdate( joystick ); + SDL_SYS_JoystickUpdate( joystick ); return (joystick); } @@ -183,12 +206,12 @@ SDL_PrivateJoystickValid(SDL_Joystick * joystick) } else { valid = 1; } - - if ( joystick && joystick->closed ) - { - valid = 0; - } - + + if ( joystick && joystick->closed ) + { + valid = 0; + } + return valid; } @@ -330,29 +353,29 @@ SDL_JoystickGetButton(SDL_Joystick * joystick, int button) /* * Return if the joystick in question is currently attached to the system, - * \return 0 if not plugged in, 1 if still present. + * \return SDL_FALSE if not plugged in, SDL_TRUE if still present. */ SDL_bool SDL_JoystickGetAttached(SDL_Joystick * joystick) { - if (!SDL_PrivateJoystickValid(joystick)) { + if (!SDL_PrivateJoystickValid(joystick)) { return SDL_FALSE; } - return SDL_SYS_JoystickAttached(joystick); + return SDL_SYS_JoystickAttached(joystick); } /* * Get the instance id for this opened joystick */ -SDL_JoystickID +SDL_JoystickID SDL_JoystickInstanceID(SDL_Joystick * joystick) { - if (!SDL_PrivateJoystickValid(joystick)) { + if (!SDL_PrivateJoystickValid(joystick)) { return (-1); } - return (joystick->instance_id); + return (joystick->instance_id); } /* @@ -364,7 +387,7 @@ SDL_JoystickName(SDL_Joystick * joystick) if (!SDL_PrivateJoystickValid(joystick)) { return (NULL); } - + return (joystick->name); } @@ -374,8 +397,8 @@ SDL_JoystickName(SDL_Joystick * joystick) void SDL_JoystickClose(SDL_Joystick * joystick) { - SDL_Joystick *joysticklist; - SDL_Joystick *joysticklistprev; + SDL_Joystick *joysticklist; + SDL_Joystick *joysticklistprev; if (!joystick) { return; @@ -391,31 +414,31 @@ SDL_JoystickClose(SDL_Joystick * joystick) } 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); + 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) { @@ -440,17 +463,42 @@ SDL_JoystickQuit(void) SDL_assert(!SDL_updating_joystick); /* Stop the event polling */ - while ( SDL_joysticks ) - { - SDL_joysticks->ref_count = 1; + while ( SDL_joysticks ) + { + SDL_joysticks->ref_count = 1; SDL_JoystickClose(SDL_joysticks); - } + } /* Quit the joystick setup */ SDL_SYS_JoystickQuit(); + +#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 */ int @@ -469,6 +517,15 @@ SDL_PrivateJoystickAxis(SDL_Joystick * joystick, Uint8 axis, Sint16 value) } 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 @@ -497,6 +554,16 @@ SDL_PrivateJoystickHat(SDL_Joystick * joystick, Uint8 hat, Uint8 value) /* Update internal joystick state */ joystick->hats[hat] = 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 @@ -523,6 +590,11 @@ SDL_PrivateJoystickBall(SDL_Joystick * joystick, Uint8 ball, return 0; } + /* We ignore events if we don't have keyboard focus. */ + if (SDL_PrivateJoystickShouldIgnoreEvent()) { + return 0; + } + /* Update internal mouse state */ joystick->balls[ball].dx += xrel; joystick->balls[ball].dy += yrel; @@ -568,6 +640,12 @@ SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state) 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; @@ -587,25 +665,24 @@ SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state) void SDL_JoystickUpdate(void) { - 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_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; - joystick->uncentered = 0; + if ( joystick->closed && joystick->uncentered ) + { + int i; /* Tell the app that everything is centered/unpressed... */ for (i = 0; i < joystick->naxes; i++) @@ -617,7 +694,8 @@ SDL_JoystickUpdate(void) for (i = 0; i < joystick->nhats; i++) SDL_PrivateJoystickHat(joystick, i, SDL_HAT_CENTERED); - } + joystick->uncentered = 0; + } SDL_updating_joystick = NULL; @@ -626,10 +704,13 @@ SDL_JoystickUpdate(void) SDL_JoystickClose(joystick); } - joystick = joysticknext; - } + joystick = joysticknext; + } - SDL_SYS_JoystickDetect(); + /* 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 @@ -665,106 +746,112 @@ SDL_JoystickEventState(int state) } /* return 1 if you want to run the joystick update loop this frame, used by hotplug support */ -SDL_bool +SDL_bool SDL_PrivateJoystickNeedsPolling() { - if (SDL_joysticks != NULL) { - return SDL_TRUE; - } else { - return SDL_SYS_JoystickNeedsPolling(); - } + if (SDL_joysticks != NULL) { + return SDL_TRUE; + } else { + return SDL_SYS_JoystickNeedsPolling(); + } } /* return the guid for this index */ SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index) { - return SDL_SYS_JoystickGetDeviceGUID( device_index ); + if ((device_index < 0) || (device_index >= 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 ); + 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; + 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]; + 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'; + *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 -//----------------------------------------------------------------------------- +/*----------------------------------------------------------------------------- + * 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 >= '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); + } - 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; + /* 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; + SDL_JoystickGUID guid; + int maxoutputbytes= sizeof(guid); + int len = SDL_strlen( pchGUID ); + Uint8 *p; + int i; - // Make sure it's even - len = ( len ) & ~0x1; + /* Make sure it's even */ + len = ( len ) & ~0x1; - SDL_memset( &guid, 0x00, sizeof(guid) ); + 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] ); - } + 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; + return guid; } diff --git a/src/joystick/SDL_joystick_c.h b/src/joystick/SDL_joystick_c.h index 526cc4623..38bc78553 100644 --- a/src/joystick/SDL_joystick_c.h +++ b/src/joystick/SDL_joystick_c.h @@ -41,7 +41,7 @@ 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(); diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c index 2e2d98a02..adaca528e 100644 --- a/src/joystick/android/SDL_sysjoystick.c +++ b/src/joystick/android/SDL_sysjoystick.c @@ -87,10 +87,10 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) joystick->nballs = 0; joystick->naxes = 3; return 0; - } else { - SDL_SetError("No joystick available with that index"); - return (-1); - } + } else { + SDL_SetError("No joystick available with that index"); + return (-1); + } } /* Function to determine is this joystick is attached to the system right now */ @@ -134,7 +134,7 @@ 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 + /* 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 ) ) ); @@ -144,7 +144,7 @@ SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) { SDL_JoystickGUID guid; - // the GUID is just the first 16 chars of the name for now + /* 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 ) ) ); diff --git a/src/joystick/beos/SDL_bejoystick.cc b/src/joystick/beos/SDL_bejoystick.cc index f8a7f14a0..4e342ed41 100644 --- a/src/joystick/beos/SDL_bejoystick.cc +++ b/src/joystick/beos/SDL_bejoystick.cc @@ -261,7 +261,7 @@ extern "C" SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) { SDL_JoystickGUID guid; - // the GUID is just the first 16 chars of the name for now + /* 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 ) ) ); @@ -271,7 +271,7 @@ extern "C" SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) { SDL_JoystickGUID guid; - // the GUID is just the first 16 chars of the name for now + /* 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 ) ) ); diff --git a/src/joystick/bsd/SDL_sysjoystick.c b/src/joystick/bsd/SDL_sysjoystick.c index bbdae328c..6d35d91b5 100644 --- a/src/joystick/bsd/SDL_sysjoystick.c +++ b/src/joystick/bsd/SDL_sysjoystick.c @@ -76,9 +76,9 @@ #include "../SDL_sysjoystick.h" #include "../SDL_joystick_c.h" -#define MAX_UHID_JOYS 16 -#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 @@ -589,7 +589,7 @@ 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 + /* 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 ) ) ); @@ -599,7 +599,7 @@ SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) { SDL_JoystickGUID guid; - // the GUID is just the first 16 chars of the name for now + /* 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 ) ) ); diff --git a/src/joystick/darwin/SDL_sysjoystick.c b/src/joystick/darwin/SDL_sysjoystick.c index ee16028b2..4e50e4dd6 100644 --- a/src/joystick/darwin/SDL_sysjoystick.c +++ b/src/joystick/darwin/SDL_sysjoystick.c @@ -64,6 +64,7 @@ static recDevice *gpDeviceList = NULL; 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; @@ -126,6 +127,7 @@ HIDRemovalCallback(void *target, IOReturn result, void *refcon, void *sender) { recDevice *device = (recDevice *) refcon; device->removed = 1; + s_bDeviceRemoved = SDL_TRUE; } @@ -135,14 +137,15 @@ void JoystickDeviceWasRemovedCallback( void * refcon, io_service_t service, natu { if( messageType == kIOMessageServiceIsTerminated && refcon ) { - recDevice *device = (recDevice *) refcon; - device->removed = 1; - } + 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 @@ -183,39 +186,39 @@ HIDCreateOpenDeviceInterface(io_object_t hidDevice, recDevice * pDevice) HIDReportErrorNum ("Failed to open pDevice->interface via open.", result); else - { - pDevice->portIterator = 0; + { + pDevice->portIterator = 0; - // It's okay if this fails, we have another detection method below + /* 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); - } - } + + /* 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 exting application +/* 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) @@ -240,12 +243,12 @@ HIDCloseReleaseInterface(recDevice * pDevice) HIDReportErrorNum("Failed to release IOHIDDeviceInterface.", result); pDevice->interface = NULL; - - if ( pDevice->portIterator ) - { - IOObjectRelease( pDevice->portIterator ); - pDevice->portIterator = 0; - } + + if ( pDevice->portIterator ) + { + IOObjectRelease( pDevice->portIterator ); + pDevice->portIterator = 0; + } } return result; } @@ -269,36 +272,36 @@ HIDGetElementInfo(CFTypeRef refElement, recElement * pElement) if (refType && CFNumberGetValue(refType, kCFNumberLongType, &number)) pElement->maxReport = pElement->max = number; /* - TODO: maybe should handle the following stuff somehow? + 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); + 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 */ @@ -359,6 +362,22 @@ HIDAddElement(CFTypeRef refElement, recDevice * pDevice) } } 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)); @@ -396,7 +415,7 @@ HIDAddElement(CFTypeRef refElement, recDevice * pDevice) } } -/* collects information from each array member in device element list (each array memeber = element) */ +/* collects information from each array member in device element list (each array member = element) */ static void HIDGetElementsCFArrayHandler(const void *value, void *parameter) @@ -461,7 +480,7 @@ HIDGetDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef hidProperties, 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 + * 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)) @@ -498,14 +517,14 @@ HIDGetDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef hidProperties, } } - refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDVendorIDKey)); + 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)); + refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDProductIDKey)); if (refCF) { if (!CFNumberGetValue(refCF, kCFNumberLongType, &pDevice->guid.data[8])) { SDL_SetError("CFNumberGetValue error retrieving pDevice->guid[8]"); @@ -570,7 +589,7 @@ HIDBuildDevice(io_object_t hidDevice) 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; + pDevice->instance_id = ++s_joystick_instance_id; } else { DisposePtr((Ptr) pDevice); pDevice = NULL; @@ -637,57 +656,57 @@ HIDDisposeDevice(recDevice ** ppDevice) /* Given an io_object_t from OSX adds a joystick device to our list if appropriate */ -int +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; + + /* 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; } @@ -697,16 +716,16 @@ AddDeviceHelper( io_object_t ioHIDDeviceObject ) void JoystickDeviceWasAddedCallback( void *refcon, io_iterator_t iterator ) { io_object_t ioHIDDeviceObject = 0; - - while ( ( ioHIDDeviceObject = IOIteratorNext(iterator) ) ) - { - if ( ioHIDDeviceObject ) - { - AddDeviceHelper( ioHIDDeviceObject ); - } - } + + while ( ( ioHIDDeviceObject = IOIteratorNext(iterator) ) ) + { + if ( ioHIDDeviceObject ) + { + AddDeviceHelper( ioHIDDeviceObject ); + } + } } - + /* Function to scan the system for joysticks. * Joystick 0 should be the system default joystick. @@ -721,7 +740,7 @@ SDL_SYS_JoystickInit(void) io_iterator_t hidObjectIterator = 0; CFMutableDictionaryRef hidMatchDictionary = NULL; io_object_t ioHIDDeviceObject = 0; - io_iterator_t portIterator = 0; + io_iterator_t portIterator = 0; if (gpDeviceList) { return SDL_SetError("Joystick: Device list already inited."); @@ -771,26 +790,26 @@ SDL_SYS_JoystickInit(void) gpDeviceList = NULL; while ((ioHIDDeviceObject = IOIteratorNext(hidObjectIterator))) { - AddDeviceHelper( ioHIDDeviceObject ); + 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). + /* 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(); } @@ -799,16 +818,17 @@ SDL_SYS_JoystickInit(void) int SDL_SYS_NumJoysticks() { - recDevice *device = gpDeviceList; + recDevice *device = gpDeviceList; int nJoySticks = 0; - - while ( device ) - { - nJoySticks++; - device = device->pNext; - } - return nJoySticks; + while ( device ) + { + if ( !device->removed ) + nJoySticks++; + device = device->pNext; + } + + return nJoySticks; } /* Function to cause any queued joystick insertions to be processed @@ -816,40 +836,81 @@ SDL_SYS_NumJoysticks() void SDL_SYS_JoystickDetect() { - if ( s_bDeviceAdded ) - { - recDevice *device = gpDeviceList; - s_bDeviceAdded = SDL_FALSE; - int device_index = 0; - // send notifications - while ( device ) - { - if ( device->send_open_event ) - { - device->send_open_event = 0; + 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); - } - } + 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 */ - } - device_index++; - device = device->pNext; - } - } + + } + + 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; + return s_bDeviceAdded || s_bDeviceRemoved; } /* Function to get the device-dependent name of a joystick */ @@ -861,7 +922,7 @@ SDL_SYS_JoystickNameForDeviceIndex(int device_index) for (; device_index > 0; device_index--) device = device->pNext; - return device->product; + return device->product; } /* Function to return the instance id of the joystick at device_index @@ -871,11 +932,11 @@ SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) { recDevice *device = gpDeviceList; int index; - + for (index = device_index; index > 0; index--) device = device->pNext; - return device->instance_id; + return device->instance_id; } /* Function to open a joystick for use. @@ -892,14 +953,14 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) for (index = device_index; index > 0; index--) device = device->pNext; - joystick->instance_id = device->instance_id; + joystick->instance_id = device->instance_id; joystick->hwdata = device; - joystick->name = device->product; + joystick->name = device->product; - joystick->naxes = device->axes; - joystick->nhats = device->hats; - joystick->nballs = 0; - joystick->nbuttons = device->buttons; + joystick->naxes = device->axes; + joystick->nhats = device->hats; + joystick->nballs = 0; + joystick->nbuttons = device->buttons; return 0; } @@ -909,17 +970,17 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick * joystick) { - recDevice *device = gpDeviceList; - - while ( device ) - { - if ( joystick->instance_id == device->instance_id ) - return SDL_TRUE; + recDevice *device = gpDeviceList; + + while ( device ) + { + if ( joystick->instance_id == device->instance_id ) + return SDL_TRUE; device = device->pNext; - } - - return SDL_FALSE; + } + + return SDL_FALSE; } /* Function to update the state of a joystick - called as a device poll. @@ -930,49 +991,49 @@ SDL_SYS_JoystickAttached(SDL_Joystick * joystick) void SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) { - recDevice *device = joystick->hwdata; + recDevice *device = joystick->hwdata; recElement *element; SInt32 value, range; int i; - if ( !device ) - return; + 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; + 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); - } - } + 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; } @@ -1054,8 +1115,8 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) /* Function to close a joystick after use */ void SDL_SYS_JoystickClose(SDL_Joystick * joystick) -{ - joystick->closed = 1; +{ + joystick->closed = 1; } /* Function to perform any system-specific joystick related cleanup */ @@ -1064,12 +1125,12 @@ SDL_SYS_JoystickQuit(void) { while (NULL != gpDeviceList) gpDeviceList = HIDDisposeDevice(&gpDeviceList); - - if ( notificationPort ) - { - IONotificationPortDestroy( notificationPort ); - notificationPort = 0; - } + + if ( notificationPort ) + { + IONotificationPortDestroy( notificationPort ); + notificationPort = 0; + } } @@ -1077,16 +1138,16 @@ 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; + + return device->guid; } SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick *joystick) { - return joystick->hwdata->guid; + return joystick->hwdata->guid; } #endif /* SDL_JOYSTICK_IOKIT */ diff --git a/src/joystick/darwin/SDL_sysjoystick_c.h b/src/joystick/darwin/SDL_sysjoystick_c.h index fc223d7e1..f99dbd8af 100644 --- a/src/joystick/darwin/SDL_sysjoystick_c.h +++ b/src/joystick/darwin/SDL_sysjoystick_c.h @@ -59,9 +59,9 @@ 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 */ - + 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 */ @@ -69,7 +69,7 @@ struct joystick_hwdata 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) */ + long elements; /* number of total elements (should be total of above) (calculated, not reported by device) */ recElement *firstAxis; recElement *firstButton; @@ -77,10 +77,10 @@ struct joystick_hwdata 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 */ + + 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 */ }; diff --git a/src/joystick/dummy/SDL_sysjoystick.c b/src/joystick/dummy/SDL_sysjoystick.c index 2f03e39c3..7dd9153b2 100644 --- a/src/joystick/dummy/SDL_sysjoystick.c +++ b/src/joystick/dummy/SDL_sysjoystick.c @@ -110,7 +110,7 @@ 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 + /* 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 ) ) ); @@ -121,7 +121,7 @@ SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) { SDL_JoystickGUID guid; - // the GUID is just the first 16 chars of the name for now + /* 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 ) ) ); diff --git a/src/joystick/iphoneos/SDLUIAccelerationDelegate.m b/src/joystick/iphoneos/SDLUIAccelerationDelegate.m index 9865d364a..0037c585b 100644 --- a/src/joystick/iphoneos/SDLUIAccelerationDelegate.m +++ b/src/joystick/iphoneos/SDLUIAccelerationDelegate.m @@ -28,114 +28,114 @@ static SDLUIAccelerationDelegate *sharedDelegate=nil; @implementation SDLUIAccelerationDelegate /* - Returns a shared instance of the SDLUIAccelerationDelegate, creating the shared delegate if it doesn't exist yet. + 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; + 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. -*/ + 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; + + 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. +/* + 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 + #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; + /* 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; + 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; + self = [super init]; + x = y = z = 0.0; + hasNewData = NO; + return self; } -(void)dealloc { - sharedDelegate = nil; - [self shutdown]; - [super dealloc]; + sharedDelegate = nil; + [self shutdown]; + [super dealloc]; } /* - Lets our delegate start receiving accelerometer updates. + Lets our delegate start receiving accelerometer updates. */ -(void)startup { - [UIAccelerometer sharedAccelerometer].delegate = self; - isRunning = YES; + [UIAccelerometer sharedAccelerometer].delegate = self; + isRunning = YES; } /* - Stops our delegate from receiving accelerometer updates. + Stops our delegate from receiving accelerometer updates. */ -(void)shutdown { - if ([UIAccelerometer sharedAccelerometer].delegate == self) { - [UIAccelerometer sharedAccelerometer].delegate = nil; - } - isRunning = NO; + if ([UIAccelerometer sharedAccelerometer].delegate == self) { + [UIAccelerometer sharedAccelerometer].delegate = nil; + } + isRunning = NO; } /* - Our we currently receiving accelerometer updates? + Our we currently receiving accelerometer updates? */ -(BOOL)isRunning { - return isRunning; + return isRunning; } /* - Do we have any data that hasn't been pumped into SDL's event system? + Do we have any data that hasn't been pumped into SDL's event system? */ -(BOOL)hasNewData { - return hasNewData; + return hasNewData; } /* - When the joystick system grabs the new data, it sets this to NO. + When the joystick system grabs the new data, it sets this to NO. */ -(void)setHasNewData:(BOOL)value { - hasNewData = value; + hasNewData = value; } @end diff --git a/src/joystick/iphoneos/SDL_sysjoystick.m b/src/joystick/iphoneos/SDL_sysjoystick.m index e93002576..231c851cf 100644 --- a/src/joystick/iphoneos/SDL_sysjoystick.m +++ b/src/joystick/iphoneos/SDL_sysjoystick.m @@ -97,20 +97,20 @@ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) 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]); - } - + 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; } @@ -118,10 +118,10 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) void SDL_SYS_JoystickClose(SDL_Joystick * joystick) { - if ([[SDLUIAccelerationDelegate sharedDelegate] isRunning]) { - [[SDLUIAccelerationDelegate sharedDelegate] shutdown]; - } - SDL_SetError("No joystick open with that index"); + if ([[SDLUIAccelerationDelegate sharedDelegate] isRunning]) { + [[SDLUIAccelerationDelegate sharedDelegate] shutdown]; + } + SDL_SetError("No joystick open with that index"); } /* Function to perform any system-specific joystick related cleanup */ @@ -133,7 +133,7 @@ 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 + /* 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 ) ) ); @@ -143,7 +143,7 @@ SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) { SDL_JoystickGUID guid; - // the GUID is just the first 16 chars of the name for now + /* 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 ) ) ); diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index 98e6c0ec0..8582838a7 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -510,7 +510,7 @@ void SDL_SYS_JoystickDetect() SDL_PushEvent(&event); } } - #endif // !SDL_EVENTS_DISABLED + #endif /* !SDL_EVENTS_DISABLED */ } } else if (SDL_strcmp(action, "remove") == 0) { const int inst = MaybeRemoveDevice(devnode); @@ -527,7 +527,7 @@ void SDL_SYS_JoystickDetect() SDL_PushEvent(&event); } } - #endif // !SDL_EVENTS_DISABLED + #endif /* !SDL_EVENTS_DISABLED */ } } UDEV_udev_device_unref(dev); @@ -760,7 +760,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) /* Get the number of buttons and axes on the joystick */ ConfigJoystick(joystick, fd); - // mark joystick as fresh and ready + /* mark joystick as fresh and ready */ joystick->hwdata->fresh = 1; return (0); @@ -840,7 +840,7 @@ PollAllValues(SDL_Joystick * joystick) struct input_absinfo absinfo; int a, b = 0; - // Poll all axis + /* Poll all axis */ for (a = ABS_X; b < ABS_MAX; a++) { switch (a) { case ABS_HAT0X: @@ -851,7 +851,7 @@ PollAllValues(SDL_Joystick * joystick) case ABS_HAT2Y: case ABS_HAT3X: case ABS_HAT3Y: - // ingore hats + /* ingore hats */ break; default: if (joystick->hwdata->abs_correct[b].used) { @@ -938,7 +938,7 @@ HandleInputEvents(SDL_Joystick * joystick) switch (code) { case SYN_DROPPED : #ifdef DEBUG_INPUT_EVENTS - printf("Event SYN_DROPPED dectected\n"); + printf("Event SYN_DROPPED detected\n"); #endif PollAllValues(joystick); break; diff --git a/src/joystick/linux/SDL_sysjoystick_c.h b/src/joystick/linux/SDL_sysjoystick_c.h index 25d33853b..4e942b54c 100644 --- a/src/joystick/linux/SDL_sysjoystick_c.h +++ b/src/joystick/linux/SDL_sysjoystick_c.h @@ -31,12 +31,12 @@ struct joystick_hwdata SDL_JoystickGUID guid; char *fname; /* Used in haptic subsystem */ - /* The current linux joystick driver maps hats to two axes */ + /* 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 */ + /* The current Linux joystick driver maps balls to two axes */ struct hwdata_ball { int axis[2]; diff --git a/src/joystick/psp/SDL_sysjoystick.c b/src/joystick/psp/SDL_sysjoystick.c index a2c51a285..d6ca6989e 100644 --- a/src/joystick/psp/SDL_sysjoystick.c +++ b/src/joystick/psp/SDL_sysjoystick.c @@ -23,7 +23,7 @@ #include #include -#include /* For the definition of NULL */ +#include /* For the definition of NULL */ #include #include "../SDL_sysjoystick.h" @@ -41,10 +41,10 @@ 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 }; + 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 @@ -53,30 +53,30 @@ typedef struct int y; } point; -// 4 points define the bezier-curve. +/* 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 +/* 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; + 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 +/* 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; + 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; } /* @@ -84,14 +84,14 @@ static int calc_bezier_y(float t) */ 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; + while (running) { + SDL_SemWait(pad_sem); + sceCtrlPeekBufferPositive(&pad, 1); + SDL_SemPost(pad_sem); + /* Delay 1/60th of a second */ + sceKernelDelayThread(1000000 / 60); + } + return 0; } @@ -103,33 +103,33 @@ int JoystickUpdate(void *data) */ int SDL_SYS_JoystickInit(void) { - int i; + int i; -// SDL_numjoysticks = 1; +/* SDL_numjoysticks = 1; */ - /* Setup input */ - sceCtrlSetSamplingCycle(0); - sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG); + /* 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"); - } + /* 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]; - } + /* 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; + return 1; } int SDL_SYS_NumJoysticks() @@ -161,11 +161,11 @@ SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int 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"; + if (index == 0) + return "PSP controller"; - SDL_SetError("No joystick available with that index"); - return(NULL); + SDL_SetError("No joystick available with that index"); + return(NULL); } /* Function to open a joystick for use. @@ -175,11 +175,11 @@ const char *SDL_SYS_JoystickName(int index) */ int SDL_SYS_JoystickOpen(SDL_Joystick *joystick, int device_index) { - joystick->nbuttons = 14; - joystick->naxes = 2; - joystick->nhats = 0; + joystick->nbuttons = 14; + joystick->naxes = 2; + joystick->nhats = 0; - return 0; + return 0; } /* Function to determine is this joystick is attached to the system right now */ @@ -195,65 +195,65 @@ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) 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; + 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); + 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; - } + /* 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 ) ) ); diff --git a/src/joystick/sort_controllers.py b/src/joystick/sort_controllers.py new file mode 100755 index 000000000..344a42328 --- /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/windows/SDL_dxjoystick.c b/src/joystick/windows/SDL_dxjoystick.c index 6ac7f338d..5a832abd8 100644 --- a/src/joystick/windows/SDL_dxjoystick.c +++ b/src/joystick/windows/SDL_dxjoystick.c @@ -23,10 +23,10 @@ #ifdef SDL_JOYSTICK_DINPUT /* DirectInput joystick driver; written by Glenn Maynard, based on Andrei de - * A. Formiga's WINMM driver. + * 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. + * 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 @@ -35,29 +35,54 @@ #include "SDL_error.h" #include "SDL_assert.h" #include "SDL_events.h" -#include "SDL_joystick.h" -#include "../SDL_sysjoystick.h" -#define INITGUID /* Only set here, if set twice will cause mingw32 to break. */ -#include "SDL_dxjoystick_c.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 +#define DIDFT_OPTIONAL 0x80000000 #endif -#define INPUT_QSIZE 32 /* Buffer up to 32 input messages */ +#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 */ +#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; @@ -96,10 +121,10 @@ WIN_LoadXInputDLL(void) } version = (1 << 16) | 4; - s_pXInputDLL = LoadLibrary( L"XInput1_4.dll" ); // 1.4 Ships with Windows 8. + 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 restributable component. + 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" ); @@ -144,14 +169,14 @@ extern HRESULT(WINAPI * DInputCreate) (HINSTANCE hinst, DWORD dwVersion, 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; + 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; @@ -173,7 +198,7 @@ static int SDL_PrivateJoystickHat_Int(SDL_Joystick * joystick, Uint8 hat, static int SDL_PrivateJoystickButton_Int(SDL_Joystick * joystick, Uint8 button, Uint8 state); -// Taken from Wine - Thanks! +/* 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}, @@ -365,289 +390,300 @@ SetDIerror(const char *function, HRESULT code) #define SAFE_RELEASE(p) \ { \ - if (p) { \ - (p)->lpVtbl->Release((p)); \ - (p) = 0; \ - } \ + 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); -//----------------------------------------------------------------------------- -// -// 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 -//----------------------------------------------------------------------------- +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 ) { - 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; + 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; } - SDL_memset( pDevices, 0x0, sizeof(pDevices) ); + // 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; + } + } - // CoInit if needed - hr = CoInitialize(NULL); - bCleanupCOM = SUCCEEDED(hr); + SDL_memset( pDevices, 0x0, sizeof(pDevices) ); - // Create WMI - hr = CoCreateInstance( &CLSID_WbemLocator, - NULL, - CLSCTX_INPROC_SERVER, - &IID_IWbemLocator, - (LPVOID*) &pIWbemLocator); - if( FAILED(hr) || pIWbemLocator == NULL ) - goto LCleanup; + /* CoInit if needed */ + hr = CoInitialize(NULL); + bCleanupCOM = SUCCEEDED(hr); - 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; + /* Create WMI */ + hr = CoCreateInstance( &CLSID_WbemLocator, + NULL, + CLSCTX_INPROC_SERVER, + &IID_IWbemLocator, + (LPVOID*) &pIWbemLocator); + if( FAILED(hr) || pIWbemLocator == 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 ); + 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; - hr = IWbemServices_CreateInstanceEnum( pIWbemServices, bstrClassName, 0, NULL, &pEnumDevices ); - if( FAILED(hr) || pEnumDevices == 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; - // 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; + /* 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 ); - for( iDevice=0; iDeviceData1 ) - { - bIsXinputDevice = SDL_TRUE; - } - } - if ( pDeviceString ) - SDL_free( pDeviceString ); + /* 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] ); + } + } - 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 ); + 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 ( bstrNamespace ) + SysFreeString( bstrNamespace ); + if ( bstrClassName ) + SysFreeString( bstrClassName ); + if ( bstrDeviceID ) + SysFreeString( bstrDeviceID ); - if( bCleanupCOM ) - CoUninitialize(); - - return bIsXinputDevice; + 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 +/* 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; - } + 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); + return DefWindowProc (hwnd, message, wParam, lParam); } DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, \ - 0xC0, 0x4F, 0xB9, 0x51, 0xED); + 0xC0, 0x4F, 0xB9, 0x51, 0xED); /* Function/thread to scan the system for joysticks. */ static int SDL_JoystickThread(void *_data) { - HRESULT result = S_OK; - HWND messageWindow = 0; - HDEVNOTIFY hNotify = 0; - DEV_BROADCAST_DEVICEINTERFACE dbh; - SDL_bool bOpenedXInputDevices[4]; - WNDCLASSEX wincl; + HWND messageWindow = 0; + HDEVNOTIFY hNotify = 0; + DEV_BROADCAST_DEVICEINTERFACE dbh; + SDL_bool bOpenedXInputDevices[4]; + WNDCLASSEX wincl; - SDL_memset( bOpenedXInputDevices, 0x0, sizeof(bOpenedXInputDevices) ); + SDL_memset( bOpenedXInputDevices, 0x0, sizeof(bOpenedXInputDevices) ); - result = WIN_CoInitialize(); + 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); + 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()); - } + 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()); - } + 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)); + SDL_memset(&dbh, 0x0, sizeof(dbh)); - dbh.dbcc_size = sizeof(dbh); - dbh.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; - dbh.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE; + 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()); - } + 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 ); + 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); - } - } + 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 ( 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++; + 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; - } - } - } + 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 + 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 ); + s_bDeviceRemoved = SDL_TRUE; + s_bDeviceAdded = SDL_TRUE; + s_bWindowsDeviceChanged = SDL_FALSE; + } + } + SDL_UnlockMutex( s_mutexJoyStickEnum ); - if ( hNotify ) - UnregisterDeviceNotification( hNotify ); + if ( hNotify ) + UnregisterDeviceNotification( hNotify ); - if ( messageWindow ) - DestroyWindow( messageWindow ); + if ( messageWindow ) + DestroyWindow( messageWindow ); - UnregisterClass( wincl.lpszClassName, wincl.hInstance ); - messageWindow = 0; - WIN_CoUninitialize(); - return 1; + UnregisterClass( wincl.lpszClassName, wincl.hInstance ); + messageWindow = 0; + WIN_CoUninitialize(); + return 1; } @@ -661,10 +697,10 @@ 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; - } + const char *env = SDL_GetHint(SDL_HINT_XINPUT_ENABLED); + if (env && !SDL_atoi(env)) { + s_bXInputEnabled = SDL_FALSE; + } result = WIN_CoInitialize(); if (FAILED(result)) { @@ -696,238 +732,237 @@ SDL_SYS_JoystickInit(void) s_mutexJoyStickEnum = SDL_CreateMutex(); s_condJoystickThread = SDL_CreateCond(); - s_bDeviceAdded = SDL_TRUE; // force a scan of the system for joysticks this first time + 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 ( !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 ); + s_threadJoystick= SDL_CreateThread( SDL_JoystickThread, "SDL_joystick", NULL, NULL, NULL ); #else - s_threadJoystick = SDL_CreateThread( SDL_JoystickThread, "SDL_joystick", NULL ); + s_threadJoystick = SDL_CreateThread( SDL_JoystickThread, "SDL_joystick", NULL ); #endif - } - return SDL_SYS_NumJoysticks(); + } + 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; - } + int nJoysticks = 0; + JoyStick_DeviceData *device = SYS_Joystick; + while ( device ) + { + nJoysticks++; + device = device->pNext; + } - return nJoysticks; + 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) + 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; - } + 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; + 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; - } + 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; - } + pPrevJoystick = pNewJoystick; + pNewJoystick = pNewJoystick->pNext; + } - s_bDeviceAdded = SDL_TRUE; + s_bDeviceAdded = SDL_TRUE; - bXInputDevice = IsXInputDevice( &pdidInstance->guidProduct ); + bXInputDevice = IsXInputDevice( &pdidInstance->guidProduct ); - pNewJoystick = (JoyStick_DeviceData *)SDL_malloc( sizeof(JoyStick_DeviceData) ); + 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)); + if ( bXInputDevice ) + { + pNewJoystick->bXInputDevice = SDL_TRUE; + pNewJoystick->XInputUserId = INVALID_XINPUT_USERID; + } + else + { + pNewJoystick->bXInputDevice = SDL_FALSE; + } - 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; + SDL_memcpy(&(pNewJoystick->dxdevice), pdidInstance, + sizeof(DIDEVICEINSTANCE)); - if ( SYS_Joystick ) - { - pNewJoystick->pNext = SYS_Joystick; - } - SYS_Joystick = pNewJoystick; + 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; - s_pKnownJoystickGUIDs[ s_iNewGUID ] = pdidInstance->guidInstance; - s_iNewGUID++; + if ( SYS_Joystick ) + { + pNewJoystick->pNext = SYS_Joystick; + } + SYS_Joystick = pNewJoystick; - if ( s_iNewGUID < MAX_JOYSTICKS ) - return DIENUM_CONTINUE; // already have this joystick loaded, just keep going - else - return DIENUM_STOP; + 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() { - HRESULT result; - 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; + 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 ); + 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 ); + if ( !s_pKnownJoystickGUIDs ) + s_pKnownJoystickGUIDs = SDL_malloc( sizeof(GUID)*MAX_JOYSTICKS ); - /* Look for joysticks, wheels, head trackers, gamepads, etc.. */ - result = IDirectInput8_EnumDevices(dinput, - DI8DEVCLASS_GAMECTRL, - EnumJoysticksCallback, - &pCurList, DIEDFL_ATTACHEDONLY); + SDL_memset( s_pKnownJoystickGUIDs, 0x0, sizeof(GUID)*MAX_JOYSTICKS ); - SDL_UnlockMutex( s_mutexJoyStickEnum ); - } + /* Look for joysticks, wheels, head trackers, gamepads, etc.. */ + IDirectInput8_EnumDevices(dinput, + DI8DEVCLASS_GAMECTRL, + EnumJoysticksCallback, + &pCurList, DIEDFL_ATTACHEDONLY); - if ( pCurList ) - { - while ( pCurList ) - { - JoyStick_DeviceData *pListNext = NULL; + SDL_UnlockMutex( s_mutexJoyStickEnum ); + } + + if ( pCurList ) + { + while ( pCurList ) + { + JoyStick_DeviceData *pListNext = NULL; #if !SDL_EVENTS_DISABLED - SDL_Event event; - event.type = SDL_JOYDEVICEREMOVED; + 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); - } - } + 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 */ - pNewJoystick->send_add_event = 0; - } - device_index++; - pNewJoystick = pNewJoystick->pNext; - } - } + + 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; + /* 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; + 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; + JoyStick_DeviceData *device = SYS_Joystick; - for (; device_index > 0; device_index--) - device = device->pNext; + for (; device_index > 0; device_index--) + device = device->pNext; - return device->joystickname; + 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; + JoyStick_DeviceData *device = SYS_Joystick; + int index; - for (index = device_index; index > 0; index--) - device = device->pNext; + for (index = device_index; index > 0; index--) + device = device->pNext; - return device->nInstanceID; + return device->nInstanceID; } /* Function to open a joystick for use. @@ -941,17 +976,17 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) HRESULT result; LPDIRECTINPUTDEVICE8 device; DIPROPDWORD dipdw; - JoyStick_DeviceData *joystickdevice = SYS_Joystick; + JoyStick_DeviceData *joystickdevice = SYS_Joystick; - for (; device_index > 0; device_index--) - joystickdevice = joystickdevice->pNext; + 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->instance_id = joystickdevice->nInstanceID; joystick->closed = 0; joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(struct joystick_hwdata)); @@ -960,194 +995,194 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) } SDL_memset(joystick->hwdata, 0, sizeof(struct joystick_hwdata)); joystick->hwdata->buffered = 1; - joystick->hwdata->removed = 0; + joystick->hwdata->removed = 0; joystick->hwdata->Capabilities.dwSize = sizeof(DIDEVCAPS); - joystick->hwdata->guid = joystickdevice->guid; + 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 ( 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 ) - { + 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 ); + 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 ( !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; + 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; - } - } + 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; + 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); - } + 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); + /* 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); - } + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::QueryInterface", result); + } - /* Aquire 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); - } + /* 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); - } + /* 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); + /* Get device capabilities */ + result = + IDirectInputDevice8_GetCapabilities(joystick->hwdata->InputDevice, + &joystick->hwdata->Capabilities); - if (FAILED(result)) { - return SetDIerror("IDirectInputDevice8::GetCapabilities", result); - } + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::GetCapabilities", result); + } - /* Force capable? */ - if (joystick->hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) { + /* Force capable? */ + if (joystick->hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) { - result = IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice); + result = IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice); - if (FAILED(result)) { - return SetDIerror("IDirectInputDevice8::Acquire", result); - } + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::Acquire", result); + } - /* reset all accuators. */ - result = - IDirectInputDevice8_SendForceFeedbackCommand(joystick->hwdata-> - InputDevice, - DISFFC_RESET); + /* 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); - } - */ + /* Not necessarily supported, ignore if not supported. + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::SendForceFeedbackCommand", result); + } + */ - result = IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice); + result = IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice); - if (FAILED(result)) { - return SetDIerror("IDirectInputDevice8::Unacquire", result); - } + 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; + /* 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); + 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); - } - */ - } + /* 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); + /* 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); + /* 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; + 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); + /* 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); - } - } + 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; + return joystick->closed == 0 && joystick->hwdata->removed == 0; } @@ -1156,48 +1191,48 @@ SDL_bool SDL_SYS_JoystickAttached( SDL_Joystick * joystick ) 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; + 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; + 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; + 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); + 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; + 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 HAT: + inputs[n].num = nHats; + nHats++; + break; - case AXIS: - inputs[n].num = nAxis; - nAxis++; - break; - } - } + case AXIS: + inputs[n].num = nAxis; + nAxis++; + break; + } + } } static BOOL CALLBACK @@ -1210,12 +1245,12 @@ EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef) if (dev->dwType & DIDFT_BUTTON) { in->type = BUTTON; in->num = joystick->nbuttons; - in->ofs = DIJOFS_BUTTON( in->num ); + 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 ); + in->ofs = DIJOFS_POV( in->num ); joystick->nhats++; } else if (dev->dwType & DIDFT_AXIS) { DIPROPRANGE diprg; @@ -1223,28 +1258,28 @@ EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef) 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 - } + /* 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); @@ -1310,12 +1345,12 @@ SDL_SYS_JoystickUpdate_Polled(SDL_Joystick * joystick) sizeof(DIJOYSTATE2), &state); } - if ( result != DI_OK ) - { - joystick->hwdata->send_remove_event = 1; - joystick->hwdata->removed = 1; - return; - } + 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) { @@ -1402,11 +1437,11 @@ SDL_SYS_JoystickUpdate_Buffered(SDL_Joystick * joystick) /* Handle the events or punt */ if (FAILED(result)) - { - joystick->hwdata->send_remove_event = 1; - joystick->hwdata->removed = 1; + { + joystick->hwdata->send_remove_event = 1; + joystick->hwdata->removed = 1; return; - } + } for (i = 0; i < (int) numevents; ++i) { int j; @@ -1443,7 +1478,7 @@ SDL_SYS_JoystickUpdate_Buffered(SDL_Joystick * joystick) */ int ButtonChanged( int ButtonsNow, int ButtonsPrev, int ButtonMask ) { - return ( ButtonsNow & ButtonMask ) != ( ButtonsPrev & ButtonMask ); + return ( ButtonsNow & ButtonMask ) != ( ButtonsPrev & ButtonMask ); } /* Function to update the state of a XInput style joystick. @@ -1451,67 +1486,67 @@ int ButtonChanged( int ButtonsNow, int ButtonsPrev, int ButtonMask ) void SDL_SYS_JoystickUpdate_XInput(SDL_Joystick * joystick) { - HRESULT result; + HRESULT result; - if ( !XINPUTGETSTATE ) - return; + 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; - } + 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]; + /* 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)(-1*pXInputState->Gamepad.sThumbLY-1) ); - SDL_PrivateJoystickAxis(joystick, 2, (Sint16)pXInputState->Gamepad.sThumbRX ); - SDL_PrivateJoystickAxis(joystick, 3, (Sint16)(-1*pXInputState->Gamepad.sThumbRY-1) ); - SDL_PrivateJoystickAxis(joystick, 4, (Sint16)((int)pXInputState->Gamepad.bLeftTrigger*32767/255) ); - SDL_PrivateJoystickAxis(joystick, 5, (Sint16)((int)pXInputState->Gamepad.bRightTrigger*32767/255) ); + 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 + 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; + joystick->hwdata->currentXInputSlot ^= 1; - } + } } @@ -1575,94 +1610,94 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) { HRESULT result; - if ( joystick->closed || !joystick->hwdata ) - return; + 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->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->buffered) + SDL_SYS_JoystickUpdate_Buffered(joystick); + else + SDL_SYS_JoystickUpdate_Polled(joystick); + } - if ( joystick->hwdata->removed ) - { - joystick->closed = 1; - joystick->uncentered = 1; - } + 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; - } - } + 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); - } + } + 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; + joystick->closed = 1; } /* Function to perform any system-specific joystick related cleanup */ void SDL_SYS_JoystickQuit(void) { - JoyStick_DeviceData *device = SYS_Joystick; + 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; + 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 + 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; - } + SDL_DestroyMutex( s_mutexJoyStickEnum ); + SDL_DestroyCond( s_condJoystickThread ); + s_condJoystickThread= NULL; + s_mutexJoyStickEnum = NULL; + s_threadJoystick = NULL; + } if (dinput != NULL) { IDirectInput8_Release(dinput); @@ -1674,11 +1709,11 @@ SDL_SYS_JoystickQuit(void) coinitialized = SDL_FALSE; } - if ( s_pKnownJoystickGUIDs ) - { - SDL_free( s_pKnownJoystickGUIDs ); - s_pKnownJoystickGUIDs = NULL; - } + if ( s_pKnownJoystickGUIDs ) + { + SDL_free( s_pKnownJoystickGUIDs ); + s_pKnownJoystickGUIDs = NULL; + } if (s_bXInputEnabled) { WIN_UnloadXInputDLL(); @@ -1689,30 +1724,30 @@ SDL_SYS_JoystickQuit(void) /* return the stable device guid for this device index */ SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) { - JoyStick_DeviceData *device = SYS_Joystick; - int index; + JoyStick_DeviceData *device = SYS_Joystick; + int index; - for (index = device_index; index > 0; index--) - device = device->pNext; + for (index = device_index; index > 0; index--) + device = device->pNext; - return device->guid; + return device->guid; } SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) { - return joystick->hwdata->guid; + 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; + JoyStick_DeviceData *device = SYS_Joystick; + int index; - for (index = device_index; index > 0; index--) - device = device->pNext; + for (index = device_index; index > 0; index--) + device = device->pNext; - return device->bXInputDevice; + return device->bXInputDevice; } #endif /* SDL_JOYSTICK_DINPUT */ diff --git a/src/joystick/windows/SDL_dxjoystick_c.h b/src/joystick/windows/SDL_dxjoystick_c.h index 13d0d451a..01cfca970 100644 --- a/src/joystick/windows/SDL_dxjoystick_c.h +++ b/src/joystick/windows/SDL_dxjoystick_c.h @@ -23,10 +23,10 @@ #ifndef SDL_JOYSTICK_DINPUT_H /* DirectInput joystick driver; written by Glenn Maynard, based on Andrei de - * A. Formiga's WINMM driver. + * 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. + * 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 @@ -34,7 +34,7 @@ #include "../../core/windows/SDL_windows.h" -#define DIRECTINPUT_VERSION 0x0800 /* Need version 7 for force feedback. Need verison 8 so IDirectInput8_EnumDevices doesn't leak like a sieve... */ +#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 @@ -57,7 +57,7 @@ typedef struct DWORD dwPaddingReserved; } XINPUT_GAMEPAD_EX; -typedef struct +typedef struct { DWORD dwPacketNumber; XINPUT_GAMEPAD_EX Gamepad; @@ -65,23 +65,23 @@ typedef struct /* 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 - ); + ( + 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 - ); + ( + 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 - ); + ( + 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); @@ -89,11 +89,11 @@ 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) +extern DWORD SDL_XInputVersion; /* ((major << 16) & 0xFF00) | (minor & 0xFF) */ -#define XINPUTGETSTATE SDL_XInputGetState -#define XINPUTSETSTATE SDL_XInputSetState -#define XINPUTGETCAPABILITIES SDL_XInputGetCapabilities +#define XINPUTGETSTATE SDL_XInputGetState +#define XINPUTSETSTATE SDL_XInputSetState +#define XINPUTGETCAPABILITIES SDL_XInputGetCapabilities #define INVALID_XINPUT_USERID 255 #define SDL_XINPUT_MAX_DEVICES 4 @@ -102,7 +102,7 @@ extern DWORD SDL_XInputVersion; // ((major << 16) & 0xFF00) | (minor & 0xFF) #endif -#define MAX_INPUTS 256 /* each joystick can have up to 256 inputs */ +#define MAX_INPUTS 256 /* each joystick can have up to 256 inputs */ /* local types */ @@ -127,18 +127,18 @@ struct joystick_hwdata LPDIRECTINPUTDEVICE8 InputDevice; DIDEVCAPS Capabilities; int buffered; - SDL_JoystickGUID guid; + 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]; + 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 index 73ad7fb95..413053f14 100644 --- a/src/joystick/windows/SDL_mmjoystick.c +++ b/src/joystick/windows/SDL_mmjoystick.c @@ -33,14 +33,14 @@ #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 */ +#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<name; SDL_zero( guid ); SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); diff --git a/src/libm/math_libm.h b/src/libm/math_libm.h index 6a6788255..45a34d8ae 100644 --- a/src/libm/math_libm.h +++ b/src/libm/math_libm.h @@ -19,73 +19,19 @@ 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" -#include "SDL_stdinc.h" /* Math routines from uClibc: http://www.uclibc.org */ -#ifdef HAVE_ATAN -#define atan SDL_uclibc_atan -#else -#define atan SDL_atan -#endif -double atan(double x); - -#ifndef HAVE_ATAN2 -#define __ieee754_atan2 SDL_atan2 -#endif - -#ifdef HAVE_COPYSIGN -#define copysign SDL_uclibc_copysign -#else -#define copysign SDL_copysign -#endif -double copysign(double x, double y); - -#ifdef HAVE_COS -#define cos SDL_uclibc_cos -#else -#define cos SDL_cos -#endif -double cos(double x); - -#ifdef HAVE_FABS -#define fabs SDL_uclibc_fabs -#else -#define fabs SDL_fabs -#endif -double fabs(double x); - -#ifdef HAVE_FLOOR -#define floor SDL_uclibc_floor -#else -#define floor SDL_floor -#endif -double floor(double x); - -#ifndef HAVE_LOG -#define __ieee754_log SDL_log -#endif - -#ifndef HAVE_POW -#define __ieee754_pow SDL_pow -#endif - -#ifdef HAVE_SCALBN -#define scalbn SDL_uclibc_scalbn -#else -#define scalbn SDL_scalbn -#endif -double scalbn(double x, int n); - -#ifdef HAVE_SIN -#define sin SDL_uclibc_sin -#else -#define sin SDL_sin -#endif -double sin(double x); - -#ifndef HAVE_SQRT -#define __ieee754_sqrt SDL_sqrt -#endif +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 index 500e7da96..c5ab63d7c 100644 --- a/src/libm/math_private.h +++ b/src/libm/math_private.h @@ -25,7 +25,21 @@ #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 * diff --git a/src/loadso/dlopen/SDL_sysloadso.c b/src/loadso/dlopen/SDL_sysloadso.c index 429727cc5..c2cbdd4c0 100644 --- a/src/loadso/dlopen/SDL_sysloadso.c +++ b/src/loadso/dlopen/SDL_sysloadso.c @@ -33,7 +33,7 @@ void * SDL_LoadObject(const char *sofile) { - void *handle = dlopen(sofile, RTLD_NOW); + void *handle = dlopen(sofile, RTLD_NOW|RTLD_LOCAL); const char *loaderror = (char *) dlerror(); if (handle == NULL) { SDL_SetError("Failed loading %s: %s", sofile, loaderror); diff --git a/src/main/android/SDL_android_main.cpp b/src/main/android/SDL_android_main.c similarity index 80% rename from src/main/android/SDL_android_main.cpp rename to src/main/android/SDL_android_main.c index 4581e1c3b..0622a12c4 100644 --- a/src/main/android/SDL_android_main.cpp +++ b/src/main/android/SDL_android_main.c @@ -12,18 +12,20 @@ #include // Called before SDL_main() to initialize JNI bindings in SDL library -extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls); +extern void SDL_Android_Init(JNIEnv* env, jclass cls); // Start up the SDL app -extern "C" void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj) +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] = strdup("SDL_app"); + argv[0] = SDL_strdup("SDL_app"); argv[1] = NULL; status = SDL_main(1, argv); diff --git a/src/main/beos/SDL_BApp.h b/src/main/beos/SDL_BApp.h index 5bde94c18..2a64455b6 100644 --- a/src/main/beos/SDL_BApp.h +++ b/src/main/beos/SDL_BApp.h @@ -54,24 +54,24 @@ 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 + /* 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 }; @@ -79,302 +79,302 @@ enum ToSDL { /* 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 */ + 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; + _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_MOUSE_BUTTON: + _HandleMouseButton(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; + 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; + 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]; - } - + + + 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(); + 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); - } + /* 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); + } - bool _GetWinID(BMessage *msg, int32 *winID) { - return msg->FindInt32("window-id", winID) == B_OK; - } + 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(); - } + /* Vector functions: Wraps vector stuff in case we need to change + implementation */ + void _SetSDLWindow(SDL_Window *win, int32 winID) { + _window_map[winID] = win; + } - void _PushBackWindow(SDL_Window *win) { - _window_map.push_back(win); - } + int32 _GetNumWindowSlots() { + return _window_map.size(); + } - /* Members */ - vector _window_map; /* Keeps track of SDL_Windows by index-id*/ + void _PopBackWindow() { + _window_map.pop_back(); + } - display_mode *_saved_mode; - BGLView *_current_context; + 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/psp/SDL_psp_main.c b/src/main/psp/SDL_psp_main.c index 0286eadec..77ef39d5a 100644 --- a/src/main/psp/SDL_psp_main.c +++ b/src/main/psp/SDL_psp_main.c @@ -30,51 +30,51 @@ /* 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. + 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. */ -extern int SDL_main(int argc, char *argv[]); - PSP_MODULE_INFO("SDL App", 0, 1, 1); int sdl_psp_exit_callback(int arg1, int arg2, void *common) { - exit(0); - return 0; + 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 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 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(); + pspDebugScreenInit(); + sdl_psp_setup_callbacks(); - /* Register sceKernelExitGame() to be called when we exit */ - atexit(sceKernelExitGame); + /* Register sceKernelExitGame() to be called when we exit */ + atexit(sceKernelExitGame); - (void)SDL_main(argc, argv); - return 0; + SDL_SetMainReady(); + + (void)SDL_main(argc, argv); + return 0; } diff --git a/src/main/windows/SDL_windows_main.c b/src/main/windows/SDL_windows_main.c index f4f78f68c..519ce14b8 100644 --- a/src/main/windows/SDL_windows_main.c +++ b/src/main/windows/SDL_windows_main.c @@ -54,7 +54,7 @@ ParseCommandLine(char *cmdline, char **argv) argc = last_argc = 0; for (bufp = cmdline; *bufp;) { /* Skip leading whitespace */ - while (isspace(*bufp)) { + while (SDL_isspace(*bufp)) { ++bufp; } /* Skip over argument */ @@ -80,7 +80,7 @@ ParseCommandLine(char *cmdline, char **argv) ++argc; } /* Skip over word */ - while (*bufp && !isspace(*bufp)) { + while (*bufp && !SDL_isspace(*bufp)) { ++bufp; } } @@ -134,6 +134,8 @@ console_main(int argc, char *argv[]) { int status; + SDL_SetMainReady(); + /* Run the application main() code */ status = SDL_main(argc, argv); @@ -174,6 +176,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) /* Run the main program */ console_main(argc, argv); + SDL_stack_free(argv); + SDL_free(cmdline); /* Hush little compiler, don't you cry... */ diff --git a/src/main/windows/version.rc b/src/main/windows/version.rc index b4c56ceb8..129a1f5dd 100644 --- a/src/main/windows/version.rc +++ b/src/main/windows/version.rc @@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,3,0,0 - PRODUCTVERSION 1,3,0,0 + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x40004L @@ -23,12 +23,12 @@ BEGIN BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "SDL\0" - VALUE "FileVersion", "1, 3, 0, 0\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", "1, 3, 0, 0\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" END END BLOCK "VarFileInfo" diff --git a/src/power/android/SDL_syspower.c b/src/power/android/SDL_syspower.c index 27f3bbaba..adedd04c7 100644 --- a/src/power/android/SDL_syspower.c +++ b/src/power/android/SDL_syspower.c @@ -59,3 +59,5 @@ SDL_GetPowerInfo_Android(SDL_PowerState * state, int *seconds, int *percent) #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 index 5c7b47cd2..8f172cc0e 100644 --- a/src/power/beos/SDL_syspower.c +++ b/src/power/beos/SDL_syspower.c @@ -50,8 +50,8 @@ SDL_GetPowerInfo_BeOS(SDL_PowerState * state, int *seconds, int *percent) uint8 battery_flags; uint8 battery_life; uint32 battery_time; - int rc; - + int rc; + if (fd == -1) { return SDL_FALSE; /* maybe some other method will work? */ } diff --git a/src/power/linux/SDL_syspower.c b/src/power/linux/SDL_syspower.c index a019e3992..d9616de25 100644 --- a/src/power/linux/SDL_syspower.c +++ b/src/power/linux/SDL_syspower.c @@ -64,7 +64,7 @@ load_acpi_file(const char *base, const char *node, const char *key, if (br < 0) { return SDL_FALSE; } - buf[br] = '\0'; // null-terminate the string. + buf[br] = '\0'; /* null-terminate the string. */ return SDL_TRUE; } @@ -342,7 +342,7 @@ SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state, return SDL_FALSE; } - buf[br] = '\0'; // null-terminate the string. + buf[br] = '\0'; /* null-terminate the string. */ if (!next_string(&ptr, &str)) { /* driver version */ return SDL_FALSE; } diff --git a/src/power/psp/SDL_syspower.c b/src/power/psp/SDL_syspower.c index 363c952d0..8c791bba4 100644 --- a/src/power/psp/SDL_syspower.c +++ b/src/power/psp/SDL_syspower.c @@ -25,7 +25,7 @@ #if SDL_POWER_PSP #include "SDL_power.h" -#include +#include SDL_bool @@ -34,31 +34,31 @@ SDL_GetPowerInfo_PSP(SDL_PowerState * state, int *seconds, { int battery = scePowerIsBatteryExist(); int plugged = scePowerIsPowerOnline(); - int charging = scePowerIsBatteryCharging(); + int charging = scePowerIsBatteryCharging(); *state = SDL_POWERSTATE_UNKNOWN; - *seconds = -1; - *percent = -1; - - if (!battery) { - *state = SDL_POWERSTATE_NO_BATTERY; - *seconds = -1; - *percent = -1; + *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; + *percent = scePowerGetBatteryLifePercent(); + *seconds = scePowerGetBatteryLifeTime()*60; } else if (plugged) { *state = SDL_POWERSTATE_CHARGED; - *percent = scePowerGetBatteryLifePercent(); - *seconds = scePowerGetBatteryLifeTime()*60; + *percent = scePowerGetBatteryLifePercent(); + *seconds = scePowerGetBatteryLifeTime()*60; } else { *state = SDL_POWERSTATE_ON_BATTERY; - *percent = scePowerGetBatteryLifePercent(); - *seconds = scePowerGetBatteryLifeTime()*60; + *percent = scePowerGetBatteryLifePercent(); + *seconds = scePowerGetBatteryLifeTime()*60; } - + return SDL_TRUE; /* always the definitive answer on PSP. */ } diff --git a/src/power/uikit/SDL_syspower.m b/src/power/uikit/SDL_syspower.m index cb309fcb4..3364da56e 100644 --- a/src/power/uikit/SDL_syspower.m +++ b/src/power/uikit/SDL_syspower.m @@ -30,7 +30,7 @@ #include "SDL_assert.h" #include "SDL_syspower.h" -// turn off the battery monitor if it's been more than X ms since last check. +/* 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; @@ -41,7 +41,7 @@ SDL_UIKit_UpdateBatteryMonitoring(void) const Uint32 prev = SDL_UIKitLastPowerInfoQuery; const UInt32 now = SDL_GetTicks(); const UInt32 ticks = now - prev; - // if timer wrapped (now < prev), shut down, too. + /* if timer wrapped (now < prev), shut down, too. */ if ((now < prev) || (ticks >= BATTERY_MONITORING_TIMEOUT)) { UIDevice *uidev = [UIDevice currentDevice]; SDL_assert([uidev isBatteryMonitoringEnabled] == YES); @@ -61,13 +61,14 @@ SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent) [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. + /* 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. + *seconds = -1; /* no API to estimate this in UIKit. */ switch ([uidev batteryState]) { diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 3887b60fe..5dfc38dcb 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -44,14 +44,11 @@ } -static const SDL_RenderDriver *render_drivers[] = { #if !SDL_RENDER_DISABLED +static const SDL_RenderDriver *render_drivers[] = { #if SDL_VIDEO_RENDER_D3D &D3D_RenderDriver, #endif -//#if SDL_VIDEO_RENDER_D3D11 -// &D3D11_RenderDriver, -//#endif #if SDL_VIDEO_RENDER_OGL &GL_RenderDriver, #endif @@ -67,13 +64,10 @@ static const SDL_RenderDriver *render_drivers[] = { #if SDL_VIDEO_RENDER_PSP &PSP_RenderDriver, #endif - &SW_RenderDriver, -#if SDL_VIDEO_RENDER_D3D11 - // WinRT, TODO: once the Direct3D 11.1 renderer is ready, make it be used over the SW renderer via SDL_CreateRenderer(window, -1, 0) - &D3D11_RenderDriver -#endif -#endif /* !SDL_RENDER_DISABLED */ + &SW_RenderDriver }; +#endif /* !SDL_RENDER_DISABLED */ + static char renderer_magic; static char texture_magic; @@ -82,18 +76,26 @@ 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 @@ -108,29 +110,11 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) renderer->WindowEvent(renderer, &event->window); } - if (event->window.event == SDL_WINDOWEVENT_RESIZED) { - if (renderer->logical_w) { - /* We'll update the renderer in the SIZE_CHANGED event */ - } else { - /* Try to keep the previous viewport centered */ - int w, h; - - SDL_GetWindowSize(window, &w, &h); - if (renderer->target) { - renderer->viewport_backup.x = (w - renderer->viewport_backup.w) / 2; - renderer->viewport_backup.y = (h - renderer->viewport_backup.h) / 2; - } else { - renderer->viewport.x = (w - renderer->viewport.w) / 2; - renderer->viewport.y = (h - renderer->viewport.h) / 2; - renderer->UpdateViewport(renderer); - } - } - renderer->resized = SDL_TRUE; - } else if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { + if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { if (renderer->logical_w) { UpdateLogicalSize(renderer); - } else if (!renderer->resized) { - /* Window was programmatically resized, reset viewport */ + } else { + /* Window was resized, reset viewport */ int w, h; SDL_GetWindowSize(window, &w, &h); @@ -147,7 +131,6 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) renderer->UpdateViewport(renderer); } } - renderer->resized = SDL_FALSE; } else if (event->window.event == SDL_WINDOWEVENT_HIDDEN) { renderer->hidden = SDL_TRUE; } else if (event->window.event == SDL_WINDOWEVENT_SHOWN) { @@ -168,6 +151,16 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) 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) { @@ -204,6 +197,7 @@ SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, 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; @@ -291,6 +285,10 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) "Created renderer: %s", renderer->info.name); } return renderer; +#else + SDL_SetError("SDL not built with rendering support"); + return NULL; +#endif } SDL_Renderer * @@ -330,6 +328,25 @@ SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * 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) { @@ -757,6 +774,13 @@ SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * 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; @@ -925,6 +949,7 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) 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; @@ -942,10 +967,11 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) renderer->viewport.h = texture->h; renderer->scale.x = 1.0f; renderer->scale.y = 1.0f; - renderer->logical_w = 0; - renderer->logical_h = 0; + 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; @@ -953,6 +979,9 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) if (renderer->UpdateViewport(renderer) < 0) { return -1; } + if (renderer->UpdateClipRect(renderer) < 0) { + return -1; + } /* All set! */ return 0; @@ -973,13 +1002,8 @@ UpdateLogicalSize(SDL_Renderer *renderer) float scale; SDL_Rect viewport; - if (renderer->target) { - SDL_QueryTexture(renderer->target, NULL, NULL, &w, &h); - } else if (renderer->window) { - SDL_GetWindowSize(renderer->window, &w, &h); - } else { - /* FIXME */ - return SDL_SetError("Internal error: No way to get output resolution"); + if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) { + return -1; } want_aspect = (float)renderer->logical_w / renderer->logical_h; @@ -1062,16 +1086,8 @@ SDL_RenderSetViewport(SDL_Renderer * renderer, const SDL_Rect * rect) } else { renderer->viewport.x = 0; renderer->viewport.y = 0; - if (renderer->target) { - SDL_QueryTexture(renderer->target, NULL, NULL, - &renderer->viewport.w, &renderer->viewport.h); - } else if (renderer->window) { - SDL_GetWindowSize(renderer->window, - &renderer->viewport.w, &renderer->viewport.h); - } else { - /* This will be filled in by UpdateViewport() */ - renderer->viewport.w = 0; - renderer->viewport.h = 0; + if (SDL_GetRendererOutputSize(renderer, &renderer->viewport.w, &renderer->viewport.h) < 0) { + return -1; } } return renderer->UpdateViewport(renderer); @@ -1090,6 +1106,35 @@ SDL_RenderGetViewport(SDL_Renderer * renderer, SDL_Rect * rect) } } +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) { @@ -1422,7 +1467,7 @@ SDL_RenderDrawRects(SDL_Renderer * renderer, int SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect) { - SDL_Rect full_rect; + SDL_Rect full_rect = { 0, 0, 0, 0 }; CHECK_RENDERER_MAGIC(renderer, -1); @@ -1504,22 +1549,10 @@ SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, real_dstrect.x = 0; real_dstrect.y = 0; if (dstrect) { - if (!SDL_IntersectRect(dstrect, &real_dstrect, &real_dstrect)) { + if (!SDL_HasIntersection(dstrect, &real_dstrect)) { return 0; } - /* Clip srcrect by the same amount as dstrect was clipped */ - if (dstrect->w != real_dstrect.w) { - int deltax = (real_dstrect.x - dstrect->x); - int deltaw = (real_dstrect.w - dstrect->w); - real_srcrect.x += (deltax * real_srcrect.w) / dstrect->w; - real_srcrect.w += (deltaw * real_srcrect.w) / dstrect->w; - } - if (dstrect->h != real_dstrect.h) { - int deltay = (real_dstrect.y - dstrect->y); - int deltah = (real_dstrect.h - dstrect->h); - real_srcrect.y += (deltay * real_srcrect.h) / dstrect->h; - real_srcrect.h += (deltah * real_srcrect.h) / dstrect->h; - } + real_dstrect = *dstrect; } if (texture->native) { @@ -1560,7 +1593,7 @@ SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, if (!renderer->RenderCopyEx) { return SDL_SetError("Renderer does not support RenderCopyEx"); } - + real_srcrect.x = 0; real_srcrect.y = 0; real_srcrect.w = texture->w; @@ -1656,9 +1689,14 @@ SDL_DestroyTexture(SDL_Texture * texture) SDL_Renderer *renderer; CHECK_TEXTURE_MAGIC(texture, ); - texture->magic = NULL; renderer = texture->renderer; + if (texture == renderer->target) { + SDL_SetRenderTarget(renderer, NULL); + } + + texture->magic = NULL; + if (texture->next) { texture->next->prev = texture->prev; } @@ -1711,11 +1749,13 @@ int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh) CHECK_TEXTURE_MAGIC(texture, -1); renderer = texture->renderer; - if (renderer && renderer->GL_BindTexture) { + 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(); } - - return SDL_Unsupported(); } int SDL_GL_UnbindTexture(SDL_Texture *texture) diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h index 83673c18b..10504654f 100644 --- a/src/render/SDL_sysrender.h +++ b/src/render/SDL_sysrender.h @@ -78,6 +78,7 @@ 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); @@ -93,6 +94,7 @@ struct SDL_Renderer 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); @@ -121,7 +123,6 @@ struct SDL_Renderer /* The window associated with the renderer */ SDL_Window *window; SDL_bool hidden; - SDL_bool resized; /* The logical resolution for rendering */ int logical_w; @@ -133,6 +134,10 @@ struct SDL_Renderer 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; diff --git a/src/render/SDL_yuv_mmx.c b/src/render/SDL_yuv_mmx.c index 6d6c000f3..b223d2d28 100644 --- a/src/render/SDL_yuv_mmx.c +++ b/src/render/SDL_yuv_mmx.c @@ -63,10 +63,10 @@ static mmx_t MMX_grn565 = { .uw = {0x07e0, 0x07e0, 0x07e0, 0x07e0} }; 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 + 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: ========== @@ -84,152 +84,152 @@ void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, Uint32 *row1; Uint32 *row2; - unsigned char* y = lum +cols*rows; // Pointer to the end + 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 + 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). + /* 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) + /* 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 + "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 + "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 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 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 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 (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 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 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 + /* 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) + /* 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 + "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 + /* 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 */ + "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 + "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 + /* 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,%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 + "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 + "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. + "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), @@ -254,125 +254,125 @@ void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, 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). + /* 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 + "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 + "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 + "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 %%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 + "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 + "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 + "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 + "pand %12, %%mm6\n" /* L3 */ "punpcklbw %%mm3, %%mm3\n" "punpcklbw %%mm5, %%mm5\n" - "pmullw %15, %%mm6\n" // lum3 + "pmullw %15, %%mm6\n" /* lum3 */ "punpcklbw %%mm7, %%mm7\n" - "psllw $3, %%mm5\n" // GREEN 2 + "psllw $3, %%mm5\n" /* GREEN 2 */ "pand %16, %%mm7\n" "pand %16, %%mm3\n" - "psrlw $11, %%mm7\n" // BLUE 2 + "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 (%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 + "pmullw %15, %%mm7\n" /* lum4 */ "punpckhwd %%mm3, %%mm5\n" - "movq %%mm4, (%3)\n" // write row1 - "movq %%mm5, 8(%3)\n" // write row1 + "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 %%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 + "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 + "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 + "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 + "paddw %%mm1, %%mm3\n" /* Lum4 +red */ "packuswb %%mm5, %%mm5\n" - "paddw %%mm2, %%mm0\n" // Lum4 +green + "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 + "psllw $3, %%mm5\n" /* GREEN 3 */ "pand %16, %%mm4\n" - "psraw $6, %%mm3\n" // psr 6 + "psraw $6, %%mm3\n" /* psr 6 */ "psraw $6, %%mm0\n" - "pand %16, %%mm6\n" // BLUE + "pand %16, %%mm6\n" /* BLUE */ "pand %17, %%mm5\n" - "psrlw $11, %%mm6\n" // BLUE 3 + "psrlw $11, %%mm6\n" /* BLUE 3 */ "por %%mm5, %%mm4\n" "psraw $6, %%mm7\n" "por %%mm6, %%mm4\n" @@ -383,8 +383,8 @@ void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, "punpcklbw %%mm0, %%mm0\n" "punpcklbw %%mm7, %%mm7\n" "pand %16, %%mm3\n" - "pand %16, %%mm7\n" // BLUE - "psllw $3, %%mm0\n" // GREEN 4 + "pand %16, %%mm7\n" /* BLUE */ + "psllw $3, %%mm0\n" /* GREEN 4 */ "psrlw $11, %%mm7\n" "pand %17, %%mm0\n" "por %%mm7, %%mm3\n" @@ -404,16 +404,16 @@ void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, "addl $4, %1\n" "cmpl %4, %6\n" "leal 16(%3), %3\n" - "leal 16(%5),%5\n" // row2+16 + "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 + "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. + "addl $4, %%esp\n" /* get rid of the stack slot we reserved. */ "emms\n" : : "m" (cr), "r"(cb),"r"(lum), diff --git a/src/render/SDL_yuv_sw.c b/src/render/SDL_yuv_sw.c index 9f04c21ca..bb235b0a2 100644 --- a/src/render/SDL_yuv_sw.c +++ b/src/render/SDL_yuv_sw.c @@ -26,17 +26,17 @@ * 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 @@ -45,17 +45,17 @@ * 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" @@ -64,17 +64,17 @@ * 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" @@ -82,6 +82,7 @@ * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ +#include "SDL_assert.h" #include "SDL_video.h" #include "SDL_cpuinfo.h" #include "SDL_yuv_sw_c.h" @@ -904,7 +905,7 @@ SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format) 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) { @@ -922,7 +923,7 @@ SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format) /* * 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 + * 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. */ @@ -1029,12 +1030,6 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) int i; int CR, CB; - swdata = (SDL_SW_YUVTexture *) SDL_calloc(1, sizeof(*swdata)); - if (!swdata) { - SDL_OutOfMemory(); - return NULL; - } - switch (format) { case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_IYUV: @@ -1043,11 +1038,16 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) case SDL_PIXELFORMAT_YVYU: break; default: - SDL_SW_DestroyYUVTexture(swdata); 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; @@ -1095,7 +1095,7 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) swdata->planes[0] = swdata->pixels; break; default: - /* We should never get here (caught above) */ + SDL_assert(0 && "We should never get here (caught above)"); break; } @@ -1202,7 +1202,11 @@ SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, break; } - *pixels = swdata->planes[0] + rect->y * swdata->pitches[0] + rect->x * 2; + 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; } diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index f75d3a98e..e9fc0ce04 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -29,7 +29,7 @@ #include "SDL_loadso.h" #include "SDL_syswm.h" #include "../SDL_sysrender.h" -#include "stdio.h" +#include #if SDL_VIDEO_RENDER_D3D #define D3D_DEBUG_INFO @@ -121,23 +121,23 @@ HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack); #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. -/////////////////////////////////////////////////////////////////////////// +/************************************************************************** + * 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, +/* {8BA5FB08-5195-40e2-AC58-0D989C3A0102} */ +DEFINE_GUID(IID_ID3DXBuffer, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); #undef INTERFACE @@ -149,12 +149,12 @@ typedef interface ID3DXBuffer { typedef const struct ID3DXBufferVtbl ID3DXBufferVtbl; const struct ID3DXBufferVtbl { - // IUnknown + /* IUnknown */ STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; - // ID3DXBuffer + /* ID3DXBuffer */ STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; }; @@ -169,6 +169,32 @@ HRESULT WINAPI 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 */ @@ -186,6 +212,7 @@ static int D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, 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); @@ -226,17 +253,27 @@ typedef struct D3DPRESENT_PARAMETERS pparams; SDL_bool updateSize; SDL_bool beginScene; - D3DTEXTUREFILTERTYPE scaleMode; + 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 @@ -335,6 +372,9 @@ PixelFormatToD3DFMT(Uint32 format) 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; } @@ -383,6 +423,8 @@ D3D_Reset(SDL_Renderer * renderer) 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; } @@ -408,7 +450,6 @@ D3D_ActivateRenderer(SDL_Renderer * renderer) if (D3D_Reset(renderer) < 0) { return -1; } - D3D_UpdateViewport(renderer); data->updateSize = SDL_FALSE; } @@ -443,7 +484,7 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_DisplayMode fullscreen_mode; D3DMATRIX matrix; int d3dxVersion; - char d3dxDLLFile[50]; + char d3dxDLLFile[50]; renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); if (!renderer) { @@ -495,7 +536,7 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) } - + if (!data->d3d || !data->matrixStack) { SDL_free(renderer); SDL_free(data); @@ -510,6 +551,7 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) 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; @@ -546,14 +588,14 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) 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 { + 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; @@ -583,7 +625,7 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) return NULL; } data->beginScene = SDL_TRUE; - data->scaleMode = D3DTEXF_FORCE_DWORD; + SDL_memset(data->scaleMode, 0xFF, sizeof(data->scaleMode)); /* Get presentation parameters to fill info */ result = IDirect3DDevice9_GetSwapChain(data->device, 0, &chain); @@ -612,6 +654,10 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) 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, @@ -634,6 +680,10 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) 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); @@ -664,6 +714,136 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) 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; } @@ -684,10 +864,8 @@ GetScaleQuality(void) if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) { return D3DTEXF_POINT; - } else if (*hint == '1' || SDL_strcasecmp(hint, "linear") == 0) { + } else /*if (*hint == '1' || SDL_strcasecmp(hint, "linear") == 0)*/ { return D3DTEXF_LINEAR; - } else { - return D3DTEXF_ANISOTROPIC; } } @@ -732,6 +910,70 @@ D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) 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; } @@ -740,46 +982,34 @@ D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch) { D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; - RECT d3drect; - D3DLOCKED_RECT locked; - const Uint8 *src; - Uint8 *dst; - int row, length; - HRESULT result; + 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) { - result = IDirect3DTexture9_LockRect(data->texture, 0, &locked, NULL, D3DLOCK_DISCARD); - } else + full_texture = SDL_TRUE; + } #endif - { - 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 (D3D_UpdateTextureInternal(data->texture, texture->format, full_texture, rect->x, rect->y, rect->w, rect->h, pixels, pitch) < 0) { + return -1; } - if (FAILED(result)) { - return D3D_SetError("LockRect()", result); - } + if (data->yuv) { + /* Skip to the correct offset into the next texture */ + pixels = (const void*)((const Uint8*)pixels + rect->h * pitch); - src = pixels; - dst = locked.pBits; - length = rect->w * SDL_BYTESPERPIXEL(texture->format); - if (length == pitch && length == locked.Pitch) { - SDL_memcpy(dst, src, length*rect->h); - } else { - for (row = 0; row < rect->h; ++row) { - SDL_memcpy(dst, src, length); - src += pitch; - dst += locked.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; } } - IDirect3DTexture9_UnlockRect(data->texture, 0); - return 0; } @@ -792,17 +1022,33 @@ D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, D3DLOCKED_RECT locked; HRESULT result; - d3drect.left = rect->x; - d3drect.right = rect->x + rect->w; - d3drect.top = rect->y; - d3drect.bottom = rect->y + rect->h; + 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); + result = IDirect3DTexture9_LockRect(data->texture, 0, &locked, &d3drect, 0); + if (FAILED(result)) { + return D3D_SetError("LockRect()", result); + } + *pixels = locked.pBits; + *pitch = locked.Pitch; } - *pixels = locked.pBits; - *pitch = locked.Pitch; return 0; } @@ -811,45 +1057,15 @@ D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) { D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; - IDirect3DTexture9_UnlockRect(data->texture, 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 */ - 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; + 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 @@ -885,6 +1101,72 @@ D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) 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) { @@ -948,6 +1230,12 @@ D3D_SetBlendMode(D3D_RenderData * data, int blendMode) 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, @@ -956,6 +1244,12 @@ D3D_SetBlendMode(D3D_RenderData * data, int blendMode) 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, @@ -964,6 +1258,12 @@ D3D_SetBlendMode(D3D_RenderData * data, int blendMode) 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; } } @@ -1138,6 +1438,18 @@ D3D_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, 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) @@ -1197,13 +1509,7 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, D3D_SetBlendMode(data, texture->blendMode); - if (texturedata->scaleMode != data->scaleMode) { - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, - texturedata->scaleMode); - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, - texturedata->scaleMode); - data->scaleMode = texturedata->scaleMode; - } + D3D_UpdateTextureScaleMode(data, texturedata, 0); result = IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *) @@ -1211,6 +1517,28 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * 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)) { @@ -1310,20 +1638,14 @@ D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, D3D_SetBlendMode(data, texture->blendMode); - // Rotate and translate + /* 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)); - if (texturedata->scaleMode != data->scaleMode) { - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, - texturedata->scaleMode); - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, - texturedata->scaleMode); - data->scaleMode = texturedata->scaleMode; - } + D3D_UpdateTextureScaleMode(data, texturedata, 0); result = IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *) @@ -1331,6 +1653,28 @@ D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * 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)) { @@ -1453,6 +1797,15 @@ D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) 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; } @@ -1463,7 +1816,7 @@ D3D_DestroyRenderer(SDL_Renderer * renderer) D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; if (data) { - // Release the render target + /* Release the render target */ if (data->defaultRenderTarget) { IDirect3DSurface9_Release(data->defaultRenderTarget); data->defaultRenderTarget = NULL; @@ -1472,12 +1825,13 @@ D3D_DestroyRenderer(SDL_Renderer * renderer) 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); diff --git a/src/render/opengl/SDL_glfuncs.h b/src/render/opengl/SDL_glfuncs.h index 03ee6b932..7544929fc 100644 --- a/src/render/opengl/SDL_glfuncs.h +++ b/src/render/opengl/SDL_glfuncs.h @@ -1,6 +1,6 @@ /* 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. + change its entry from SDL_PROC_UNUSED to SDL_PROC and rebuild. */ #define SDL_PROC_UNUSED(ret,func,params) @@ -15,6 +15,7 @@ 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)) @@ -152,7 +153,7 @@ SDL_PROC_UNUSED(void, glGetMaterialiv, 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(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, diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 30d0716bb..697a974c5 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -56,6 +56,7 @@ static int GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, 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); @@ -99,13 +100,21 @@ struct GL_FBOList 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; @@ -118,7 +127,7 @@ typedef struct SDL_bool GL_ARB_multitexture_supported; PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; GLint num_texture_units; - + PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT; PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT; PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT; @@ -146,11 +155,11 @@ typedef struct SDL_bool yuv; GLuint utexture; GLuint vtexture; - + GL_FBOList *fbo; } GL_TextureData; -static __inline__ const char* +SDL_FORCE_INLINE const char* GL_TranslateError (GLenum error) { #define GL_ERROR_TRANSLATE(e) case e: return #e; @@ -169,22 +178,65 @@ GL_TranslateError (GLenum error) #undef GL_ERROR_TRANSLATE } -static __inline__ int -GL_CheckAllErrors (const char *prefix, SDL_Renderer * renderer, const char *file, int line, const char *function) +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; - /* 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"; + + 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; } - SDL_SetError("%s: %s (%d): %s %s (0x%X)", prefix, file, line, function, GL_TranslateError(error), error); - ret++; - } else { - break; } } return ret; @@ -233,6 +285,9 @@ GL_ActivateRenderer(SDL_Renderer * renderer) GL_UpdateViewport(renderer); } + + GL_ClearErrors(renderer); + return 0; } @@ -263,8 +318,34 @@ GL_ResetState(SDL_Renderer *renderer) 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; -GL_FBOList * + 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; @@ -324,6 +405,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) 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; @@ -372,6 +454,23 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) 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; @@ -406,7 +505,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) 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) @@ -440,7 +539,7 @@ GL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } } -static __inline__ int +SDL_FORCE_INLINE int power_of_2(int input) { int value = 1; @@ -451,7 +550,7 @@ power_of_2(int input) return value; } -static __inline__ SDL_bool +SDL_FORCE_INLINE SDL_bool convert_format(GL_RenderData *renderdata, Uint32 pixel_format, GLint* internalFormat, GLenum* format, GLenum* type) { @@ -525,7 +624,7 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } texture->driverdata = data; - + if (texture->access == SDL_TEXTUREACCESS_TARGET) { data->fbo = GL_GetFBO(renderdata, texture->w, texture->h); } else { @@ -534,6 +633,10 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) 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; @@ -600,7 +703,7 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) texture_h, 0, format, type, NULL); } renderdata->glDisable(data->type); - if (GL_CheckError("glTexImage2D()", renderer) > 0) { + if (GL_CheckError("glTexImage2D()", renderer) < 0) { return -1; } @@ -639,8 +742,7 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) renderdata->glDisable(data->type); } - GL_CheckError("", renderer); - return 0; + return GL_CheckError("", renderer); } static int @@ -652,7 +754,6 @@ GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, GL_ActivateRenderer(renderer); - GL_CheckError("", renderer); renderdata->glEnable(data->type); renderdata->glBindTexture(data->type, data->texture); renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); @@ -687,10 +788,7 @@ GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, data->format, data->formattype, pixels); } renderdata->glDisable(data->type); - if (GL_CheckError("glTexSubImage2D()", renderer) > 0) { - return -1; - } - return 0; + return GL_CheckError("glTexSubImage2D()", renderer); } static int @@ -700,7 +798,7 @@ GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, GL_TextureData *data = (GL_TextureData *) texture->driverdata; data->locked_rect = *rect; - *pixels = + *pixels = (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = data->pitch; @@ -715,7 +813,7 @@ GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) void *pixels; rect = &data->locked_rect; - pixels = + pixels = (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + rect->x * SDL_BYTESPERPIXEL(texture->format)); GL_UpdateTexture(renderer, texture, rect, pixels, data->pitch); @@ -724,12 +822,12 @@ GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) static int GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + 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; @@ -757,30 +855,41 @@ GL_UpdateViewport(SDL_Renderer * renderer) return 0; } - if (!renderer->viewport.w || !renderer->viewport.h) { - /* The viewport isn't set up yet, ignore it */ - return -1; - } - data->glViewport(renderer->viewport.x, renderer->viewport.y, renderer->viewport.w, renderer->viewport.h); data->glMatrixMode(GL_PROJECTION); data->glLoadIdentity(); - 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); + 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); } - GL_CheckError("", renderer); return 0; } @@ -819,17 +928,17 @@ GL_SetBlendMode(GL_RenderData * data, int blendMode) case SDL_BLENDMODE_BLEND: data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); data->glEnable(GL_BLEND); - data->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + 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->glBlendFunc(GL_SRC_ALPHA, GL_ONE); + 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->glBlendFunc(GL_ZERO, GL_SRC_COLOR); + data->glBlendFuncSeparate(GL_ZERO, GL_SRC_COLOR, GL_ZERO, GL_ONE); break; } data->current.blendMode = blendMode; @@ -897,7 +1006,7 @@ GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points, GL_SetDrawingState(renderer); - if (count > 2 && + 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 */ @@ -948,9 +1057,7 @@ GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points, #endif data->glEnd(); } - GL_CheckError("", renderer); - - return 0; + return GL_CheckError("", renderer); } static int @@ -966,9 +1073,7 @@ GL_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, int count) data->glRectf(rect->x, rect->y, rect->x + rect->w, rect->y + rect->h); } - GL_CheckError("", renderer); - - return 0; + return GL_CheckError("", renderer); } static int @@ -1035,9 +1140,7 @@ GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, data->glDisable(texturedata->type); - GL_CheckError("", renderer); - - return 0; + return GL_CheckError("", renderer); } static int @@ -1050,6 +1153,7 @@ GL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, GLfloat minx, miny, maxx, maxy; GLfloat centerx, centery; GLfloat minu, maxu, minv, maxv; + GL_ActivateRenderer(renderer); data->glEnable(texturedata->type); @@ -1108,11 +1212,11 @@ GL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h; maxv *= texturedata->texh; - // Translate to flip, rotate, translate to position + /* Translate to flip, rotate, translate to position */ data->glPushMatrix(); - data->glTranslatef((GLfloat)dstrect->x + centerx, (GLfloat)dstrect->y + centery, (GLfloat)0.0); + 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); @@ -1124,12 +1228,10 @@ GL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, data->glVertex2f(maxx, maxy); data->glEnd(); data->glPopMatrix(); - + data->glDisable(texturedata->type); - GL_CheckError("", renderer); - - return 0; + return GL_CheckError("", renderer); } static int @@ -1137,7 +1239,6 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 pixel_format, void * pixels, int pitch) { GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - SDL_Window *window = renderer->window; Uint32 temp_format = SDL_PIXELFORMAT_ARGB8888; void *temp_pixels; int temp_pitch; @@ -1157,7 +1258,7 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, convert_format(data, temp_format, &internalFormat, &format, &type); - SDL_GetWindowSize(window, &w, &h); + SDL_GetRendererOutputSize(renderer, &w, &h); data->glPixelStorei(GL_PACK_ALIGNMENT, 1); data->glPixelStorei(GL_PACK_ROW_LENGTH, @@ -1230,6 +1331,14 @@ 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); } @@ -1241,8 +1350,7 @@ GL_DestroyRenderer(SDL_Renderer * renderer) GL_CheckError("", renderer); SDL_free(data->framebuffers); data->framebuffers = nextnode; - } - /* SDL_GL_MakeCurrent(0, NULL); *//* doesn't do anything */ + } SDL_GL_DeleteContext(data->context); } SDL_free(data); @@ -1250,7 +1358,9 @@ GL_DestroyRenderer(SDL_Renderer * renderer) SDL_free(renderer); } -static int GL_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh) { +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); @@ -1273,7 +1383,9 @@ static int GL_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float return 0; } -static int GL_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) { +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); @@ -1287,7 +1399,7 @@ static int GL_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) { data->glActiveTextureARB(GL_TEXTURE0_ARB); } - + data->glDisable(texturedata->type); return 0; diff --git a/src/render/opengl/SDL_shaders_gl.c b/src/render/opengl/SDL_shaders_gl.c index 9b75032ef..1e6262191 100644 --- a/src/render/opengl/SDL_shaders_gl.c +++ b/src/render/opengl/SDL_shaders_gl.c @@ -216,7 +216,7 @@ CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data) /* Make sure we use the correct sampler type for our texture type */ if (ctx->GL_ARB_texture_rectangle_supported) { - frag_defines = + frag_defines = "#define sampler2D sampler2DRect\n" "#define texture2D texture2DRect\n"; } @@ -252,7 +252,7 @@ CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data) } } ctx->glUseProgramObjectARB(0); - + return (ctx->glGetError() == GL_NO_ERROR); } diff --git a/src/render/opengles/SDL_glesfuncs.h b/src/render/opengles/SDL_glesfuncs.h index aade01229..4a6384da6 100644 --- a/src/render/opengles/SDL_glesfuncs.h +++ b/src/render/opengles/SDL_glesfuncs.h @@ -1,5 +1,6 @@ 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)) @@ -20,6 +21,7 @@ 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 *)) diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c index 62b547b2c..ab0f01d4e 100644 --- a/src/render/opengles/SDL_render_gles.c +++ b/src/render/opengles/SDL_render_gles.c @@ -59,6 +59,7 @@ static void GLES_UnlockTexture(SDL_Renderer * renderer, 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); @@ -120,6 +121,7 @@ typedef struct SDL_bool useDrawTexture; SDL_bool GL_OES_draw_texture_supported; + SDL_bool GL_OES_blend_func_separate_supported; } GLES_RenderData; typedef struct @@ -188,7 +190,7 @@ static int GLES_LoadFunctions(GLES_RenderData * data) if ( ! data->func ) { \ return SDL_SetError("Couldn't load GLES function %s: %s\n", #func, SDL_GetError()); \ } \ - } while ( 0 ); + } while ( 0 ); #endif /* _SDL_NOGETPROCADDR_ */ #include "SDL_glesfuncs.h" @@ -269,11 +271,11 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) 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) { @@ -303,6 +305,7 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) 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; @@ -374,6 +377,10 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) } 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); @@ -384,7 +391,7 @@ 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) { @@ -468,6 +475,11 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) 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) */ @@ -621,12 +633,34 @@ GLES_UpdateViewport(SDL_Renderer * renderer) data->glViewport(renderer->viewport.x, renderer->viewport.y, 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); + 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; } @@ -656,17 +690,29 @@ GLES_SetBlendMode(GLES_RenderData * data, int blendMode) case SDL_BLENDMODE_BLEND: data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); data->glEnable(GL_BLEND); - data->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + 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); - data->glBlendFunc(GL_SRC_ALPHA, GL_ONE); + 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); - data->glBlendFunc(GL_ZERO, GL_SRC_COLOR); + 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; @@ -743,7 +789,7 @@ GLES_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points, GLES_SetDrawingState(renderer); data->glVertexPointer(2, GL_FLOAT, 0, points); - if (count > 2 && + 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; @@ -898,7 +944,7 @@ GLES_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, GLfloat minx, miny, maxx, maxy; GLfloat minu, maxu, minv, maxv; GLfloat centerx, centery; - + GLES_ActivateRenderer(renderer); data->glEnable(GL_TEXTURE_2D); @@ -918,7 +964,7 @@ GLES_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, centerx = center->x; centery = center->y; - // Rotate and translate + /* 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); @@ -982,7 +1028,6 @@ GLES_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 pixel_format, void * pixels, int pitch) { GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; - SDL_Window *window = renderer->window; Uint32 temp_format = SDL_PIXELFORMAT_ABGR8888; void *temp_pixels; int temp_pitch; @@ -998,7 +1043,7 @@ GLES_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return SDL_OutOfMemory(); } - SDL_GetWindowSize(window, &w, &h); + SDL_GetRendererOutputSize(renderer, &w, &h); data->glPixelStorei(GL_PACK_ALIGNMENT, 1); diff --git a/src/render/opengles2/SDL_gles2funcs.h b/src/render/opengles2/SDL_gles2funcs.h index 7b7d5e17d..b201bdfd1 100644 --- a/src/render/opengles2/SDL_gles2funcs.h +++ b/src/render/opengles2/SDL_gles2funcs.h @@ -2,7 +2,7 @@ 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, glBlendFunc, (GLenum, GLenum)) +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)) @@ -30,6 +30,7 @@ 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 *)) diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 0d6fe5d0e..a0ab94365 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -275,6 +275,26 @@ GLES2_UpdateViewport(SDL_Renderer * 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) { @@ -398,6 +418,10 @@ GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) /* 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); @@ -405,8 +429,7 @@ GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) 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) - { + if (rdata->glGetError() != GL_NO_ERROR) { rdata->glDeleteTextures(1, &tdata->texture); SDL_free(tdata); return SDL_SetError("Texture creation failed"); @@ -886,6 +909,10 @@ GLES2_SetOrthographicProjection(SDL_Renderer *renderer) 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; @@ -934,11 +961,11 @@ static int GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_FPoint *point 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_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 pixel_format, void * pixels, int pitch); 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); @@ -970,15 +997,15 @@ GLES2_SetBlendMode(GLES2_DriverContext *rdata, int blendMode) break; case SDL_BLENDMODE_BLEND: rdata->glEnable(GL_BLEND); - rdata->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + 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->glBlendFunc(GL_SRC_ALPHA, GL_ONE); + rdata->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_ONE); break; case SDL_BLENDMODE_MOD: rdata->glEnable(GL_BLEND); - rdata->glBlendFunc(GL_ZERO, GL_SRC_COLOR); + rdata->glBlendFuncSeparate(GL_ZERO, GL_SRC_COLOR, GL_ZERO, GL_ONE); break; } rdata->current.blendMode = blendMode; @@ -1062,7 +1089,7 @@ GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int cou rdata->glDrawArrays(GL_POINTS, 0, count); SDL_stack_free(vertices); if (rdata->glGetError() != GL_NO_ERROR) { - return SDL_SetError("Failed to render lines"); + return SDL_SetError("Failed to render points"); } return 0; } @@ -1136,7 +1163,7 @@ GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count) rdata->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } if (rdata->glGetError() != GL_NO_ERROR) { - return SDL_SetError("Failed to render lines"); + return SDL_SetError("Failed to render filled rects"); } return 0; } @@ -1217,7 +1244,7 @@ GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *s break; } } - else sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; // Texture formats match, use the non color mapping shader (even if the formats are not ABGR) + 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) @@ -1314,7 +1341,7 @@ GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect 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); @@ -1383,7 +1410,7 @@ GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect break; } } - else sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; // Texture formats match, use the non color mapping shader (even if the formats are not ABGR) + 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) @@ -1456,7 +1483,7 @@ GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect 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); @@ -1484,7 +1511,6 @@ GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 pixel_format, void * pixels, int pitch) { GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; - SDL_Window *window = renderer->window; Uint32 temp_format = SDL_PIXELFORMAT_ABGR8888; void *temp_pixels; int temp_pitch; @@ -1500,7 +1526,7 @@ GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return SDL_OutOfMemory(); } - SDL_GetWindowSize(window, &w, &h); + SDL_GetRendererOutputSize(renderer, &w, &h); rdata->glPixelStorei(GL_PACK_ALIGNMENT, 1); @@ -1708,13 +1734,14 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) 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->RenderReadPixels = &GLES2_RenderReadPixels; renderer->RenderCopyEx = &GLES2_RenderCopyEx; + renderer->RenderReadPixels = &GLES2_RenderReadPixels; renderer->RenderPresent = &GLES2_RenderPresent; renderer->DestroyTexture = &GLES2_DestroyTexture; renderer->DestroyRenderer = &GLES2_DestroyRenderer; diff --git a/src/render/opengles2/SDL_shaders_gles2.c b/src/render/opengles2/SDL_shaders_gles2.c index 3d3a2416c..fb6921fd0 100644 --- a/src/render/opengles2/SDL_shaders_gles2.c +++ b/src/render/opengles2/SDL_shaders_gles2.c @@ -75,7 +75,7 @@ static const Uint8 GLES2_FragmentSrc_TextureABGRSrc_[] = " \ } \ "; -// ARGB to ABGR conversion +/* ARGB to ABGR conversion */ static const Uint8 GLES2_FragmentSrc_TextureARGBSrc_[] = " \ precision mediump float; \ uniform sampler2D u_texture; \ @@ -92,7 +92,7 @@ static const Uint8 GLES2_FragmentSrc_TextureARGBSrc_[] = " \ } \ "; -// RGB to ABGR conversion +/* RGB to ABGR conversion */ static const Uint8 GLES2_FragmentSrc_TextureRGBSrc_[] = " \ precision mediump float; \ uniform sampler2D u_texture; \ @@ -110,7 +110,7 @@ static const Uint8 GLES2_FragmentSrc_TextureRGBSrc_[] = " \ } \ "; -// BGR to ABGR conversion +/* BGR to ABGR conversion */ static const Uint8 GLES2_FragmentSrc_TextureBGRSrc_[] = " \ precision mediump float; \ uniform sampler2D u_texture; \ @@ -744,7 +744,7 @@ const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMo default: return NULL; } - + case GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC: switch (blendMode) { @@ -759,7 +759,7 @@ const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMo default: return NULL; } - + case GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC: switch (blendMode) { @@ -774,7 +774,7 @@ const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMo default: return NULL; } - + default: return NULL; } diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c index 3bcd87965..7ea536d14 100644 --- a/src/render/psp/SDL_render_psp.c +++ b/src/render/psp/SDL_render_psp.c @@ -20,7 +20,7 @@ */ #include "SDL_config.h" -#if SDL_VIDEO_RENDER_PSP +#if SDL_VIDEO_RENDER_PSP #include "SDL_hints.h" #include "../SDL_sysrender.h" @@ -93,94 +93,94 @@ SDL_RenderDriver PSP_RenderDriver = { }; */ SDL_RenderDriver PSP_RenderDriver = { - .CreateRenderer = PSP_CreateRenderer, + .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, + .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_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) +#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)) - + +#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; - + 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. */ + 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; +{ + float x, y, z; } VertV; typedef struct { - float u, v; - float x, y, z; - + float u, v; + float x, y, z; + } VertTV; -// Return next power of 2 -static int +/* Return next power of 2 */ +static int TextureNextPow2(unsigned int w) { - if(w == 0) - return 0; + if(w == 0) + return 0; - unsigned int n = 2; + unsigned int n = 2; - while(w > n) - n <<= 1; + while(w > n) + n <<= 1; - return n; + return n; } @@ -190,9 +190,9 @@ 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 + return GU_NEAREST; /* GU_NEAREST good for tile-map */ } else { - return GU_LINEAR; // GU_LINEAR good for scaling + return GU_LINEAR; /* GU_LINEAR good for scaling */ } } @@ -207,133 +207,133 @@ PixelFormatToPSPFMT(Uint32 format) case SDL_PIXELFORMAT_ABGR4444: return GU_PSM_4444; case SDL_PIXELFORMAT_ABGR8888: - return GU_PSM_8888; - default: + return GU_PSM_8888; + default: return GU_PSM_8888; } } -void +void StartDrawing(SDL_Renderer * renderer) -{ - PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; - if(data->displayListAvail) - return; +{ + PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + if(data->displayListAvail) + return; - sceGuStart(GU_DIRECT, DisplayList); - data->displayListAvail = SDL_TRUE; + sceGuStart(GU_DIRECT, DisplayList); + data->displayListAvail = SDL_TRUE; } -int +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; + if(psp_texture->swizzled) + return 1; - int rowblocks = (bytewidth>>4); - int rowblocksadd = (rowblocks-1)<<7; - unsigned int blockaddress = 0; - unsigned int *src = (unsigned int*) psp_texture->data; + int bytewidth = psp_texture->textureWidth*(psp_texture->bits>>3); + int height = psp_texture->size / bytewidth; - unsigned char *data = NULL; - data = malloc(psp_texture->size); + int rowblocks = (bytewidth>>4); + int rowblocksadd = (rowblocks-1)<<7; + unsigned int blockaddress = 0; + unsigned int *src = (unsigned int*) psp_texture->data; - int j; + unsigned char *data = NULL; + data = malloc(psp_texture->size); - for(j = 0; j < height; j++, blockaddress += 16) - { - unsigned int *block; + int j; - block = (unsigned int*)&data[blockaddress]; + for(j = 0; j < height; j++, blockaddress += 16) + { + unsigned int *block; - int i; + block = (unsigned int*)&data[blockaddress]; - for(i = 0; i < rowblocks; i++) - { - *block++ = *src++; - *block++ = *src++; - *block++ = *src++; - *block++ = *src++; - block += 28; - } + int i; - if((j & 0x7) == 0x7) - blockaddress += rowblocksadd; - } + for(i = 0; i < rowblocks; i++) + { + *block++ = *src++; + *block++ = *src++; + *block++ = *src++; + *block++ = *src++; + block += 28; + } - free(psp_texture->data); - psp_texture->data = data; - psp_texture->swizzled = SDL_TRUE; + if((j & 0x7) == 0x7) + blockaddress += rowblocksadd; + } - return 1; + 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; + if(!psp_texture->swizzled) + return 1; - unsigned int *src = (unsigned int*) psp_texture->data; + int blockx, blocky; - unsigned char *data = NULL; - - data = malloc(psp_texture->size); + int bytewidth = psp_texture->textureWidth*(psp_texture->bits>>3); + int height = psp_texture->size / bytewidth; - if(!data) - return 0; - - sceKernelDcacheWritebackAll(); + int widthblocks = bytewidth/16; + int heightblocks = height/8; - int j; - - unsigned char *ydst = (unsigned char *)data; + int dstpitch = (bytewidth - 16)/4; + int dstrow = bytewidth * 8; - for(blocky = 0; blocky < heightblocks; ++blocky) - { - unsigned char *xdst = ydst; - - for(blockx = 0; blockx < widthblocks; ++blockx) - { - unsigned int *block; + unsigned int *src = (unsigned int*) psp_texture->data; - block = (unsigned int*)xdst; + unsigned char *data = NULL; - for(j = 0; j < 8; ++j) - { - *(block++) = *(src++); - *(block++) = *(src++); - *(block++) = *(src++); - *(block++) = *(src++); - block += dstpitch; - } + data = malloc(psp_texture->size); - xdst += 16; - } - - ydst += dstrow; - } + if(!data) + return 0; - free(psp_texture->data); - - psp_texture->data = data; + sceKernelDcacheWritebackAll(); - psp_texture->swizzled = SDL_FALSE; + int j; - return 1; + 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 * @@ -342,7 +342,7 @@ PSP_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_Renderer *renderer; PSP_RenderData *data; - int pixelformat; + int pixelformat; renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); if (!renderer) { SDL_OutOfMemory(); @@ -355,8 +355,8 @@ PSP_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_OutOfMemory(); return NULL; } - - + + renderer->WindowEvent = PSP_WindowEvent; renderer->CreateTexture = PSP_CreateTexture; renderer->UpdateTexture = PSP_UpdateTexture; @@ -378,73 +378,73 @@ PSP_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.flags = SDL_RENDERER_ACCELERATED; renderer->driverdata = data; renderer->window = window; - - if (data->initialized != SDL_FALSE) - return 0; - data->initialized = SDL_TRUE; - + + 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); + + 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); + 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); + /* 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); - sceGuTexFilter(GU_LINEAR,GU_LINEAR); - - sceGuFinish(); - sceGuSync(0,0); - sceDisplayWaitVblankStartCB(); - sceGuDisplay(GU_TRUE); - return renderer; } @@ -458,69 +458,69 @@ 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_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata; + PSP_TextureData* psp_texture = (PSP_TextureData*) SDL_calloc(1, sizeof(*psp_texture));; - 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); + if(!psp_texture) + return -1; - 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->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); - 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(); - } + 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 +void TextureActivate(SDL_Texture * texture) -{ - PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; - int scaleMode = GetScaleQuality(); - - // Swizzling is useless with small textures. +{ + 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); + 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); + + 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); } @@ -528,12 +528,12 @@ 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; +// 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) { @@ -545,8 +545,8 @@ PSP_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, dst += dpitch; } } - - sceKernelDcacheWritebackAll(); + + sceKernelDcacheWritebackAll(); return 0; } @@ -554,7 +554,7 @@ 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; + PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; *pixels = (void *) ((Uint8 *) psp_texture->data + rect->y * psp_texture->pitch + @@ -566,7 +566,7 @@ PSP_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, static void PSP_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) { - PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; SDL_Rect rect; /* We do whole texture updates, at least for now */ @@ -595,27 +595,27 @@ PSP_UpdateViewport(SDL_Renderer * renderer) static void PSP_SetBlendMode(SDL_Renderer * renderer, int blendMode) { - PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + 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); + 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 ); + 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 ); + 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); + sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA); + sceGuEnable(GU_BLEND); + sceGuBlendFunc( GU_ADD, GU_FIX, GU_SRC_COLOR, 0, 0); break; } data->currentBlendMode = blendMode; @@ -626,13 +626,13 @@ PSP_SetBlendMode(SDL_Renderer * renderer, int 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); +{ + /* 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; } @@ -641,22 +641,22 @@ 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); + 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; } @@ -665,24 +665,24 @@ 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; - } + 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); - 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; } @@ -690,29 +690,29 @@ 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; + int color = renderer->a << 24 | renderer->b << 16 | renderer->g << 8 | renderer->r; + int i; + StartDrawing(renderer); - 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); + 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; } @@ -724,127 +724,127 @@ PSP_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, float MathAbs(float x) { - float result; + float result; - __asm__ volatile ( - "mtv %1, S000\n" - "vabs.s S000, S000\n" - "mfv %0, S000\n" - : "=r"(result) : "r"(x)); + __asm__ volatile ( + "mtv %1, S000\n" + "vabs.s S000, S000\n" + "mfv %0, S000\n" + : "=r"(result) : "r"(x)); - return result; + 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)); + __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; + 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; + float x, y, width, height; + float u0, v0, u1, v1; + unsigned char alpha; - 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); + x = dstrect->x; + y = dstrect->y; + width = dstrect->w; + height = dstrect->h; - vertices[0].u = u0; - vertices[0].v = v0; - vertices[0].x = x; - vertices[0].y = y; - vertices[0].z = 0; + u0 = srcrect->x; + v0 = srcrect->y; + u1 = srcrect->x + srcrect->w; + v1 = srcrect->y + srcrect->h; - vertices[1].u = u1; - vertices[1].v = v1; - vertices[1].x = x + width; - vertices[1].y = y + height; - vertices[1].z = 0; + alpha = texture->a; - 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; + StartDrawing(renderer); + TextureActivate(texture); + PSP_SetBlendMode(renderer, renderer->blendMode); - for(start = 0, end = width; start < end; start += slice) - { - VertTV* vertices = (VertTV*)sceGuGetMemory((sizeof(VertTV))<<1); + 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); + } - float polyWidth = ((curX + slice) > endX) ? (endX - curX) : slice; - float sourceWidth = ((curU + ustep) > u1) ? (u1 - curU) : ustep; + if((MathAbs(u1) - MathAbs(u0)) < 64.0f) + { + VertTV* vertices = (VertTV*)sceGuGetMemory((sizeof(VertTV))<<1); - vertices[0].u = curU; - vertices[0].v = v0; - vertices[0].x = curX; - vertices[0].y = y; - vertices[0].z = 0; + vertices[0].u = u0; + vertices[0].v = v0; + vertices[0].x = x; + vertices[0].y = y; + vertices[0].z = 0; - curU += sourceWidth; - curX += polyWidth; + vertices[1].u = u1; + vertices[1].v = v1; + vertices[1].x = x + width; + vertices[1].y = y + height; + vertices[1].z = 0; - 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); + } + else + { + float start, end; + float curU = u0; + float curX = x; + float endX = x + width; + float slice = 64.0f; + float ustep = (u1 - u0)/width * slice; - 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); + 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; } @@ -853,7 +853,7 @@ PSP_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 pixel_format, void * pixels, int pitch) { - return 0; + return 0; } @@ -862,98 +862,98 @@ 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; + 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; - 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; + alpha = texture->a; - VertTV* vertices = (VertTV*)sceGuGetMemory(sizeof(VertTV)<<2); + StartDrawing(renderer); + TextureActivate(texture); + PSP_SetBlendMode(renderer, renderer->blendMode); - 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); - } + 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); + } - 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); +// 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; } @@ -961,39 +961,39 @@ 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(); - + 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; + PSP_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; - if(psp_texture == 0) - return; + if (renderdata == 0) + return; - if(psp_texture->data != 0) - { - free(psp_texture->data); - } - free(texture); - texture->driverdata = NULL; + if(psp_texture == 0) + return; + + if(psp_texture->data != 0) + { + SDL_free(psp_texture->data); + } + SDL_free(psp_texture); + texture->driverdata = NULL; } static void @@ -1001,17 +1001,17 @@ PSP_DestroyRenderer(SDL_Renderer * renderer) { PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; if (data) { - if (!data->initialized) - return; + if (!data->initialized) + return; - StartDrawing(renderer); - - sceGuTerm(); -// vfree(data->backbuffer); -// vfree(data->frontbuffer); - - data->initialized = SDL_FALSE; - data->displayListAvail = SDL_FALSE; + StartDrawing(renderer); + + sceGuTerm(); +// vfree(data->backbuffer); +// vfree(data->frontbuffer); + + data->initialized = SDL_FALSE; + data->displayListAvail = SDL_FALSE; SDL_free(data); } SDL_free(renderer); diff --git a/src/render/software/SDL_drawline.c b/src/render/software/SDL_drawline.c index 9f5da0ab6..5cda4ccca 100644 --- a/src/render/software/SDL_drawline.c +++ b/src/render/software/SDL_drawline.c @@ -32,7 +32,6 @@ SDL_DrawLine1(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, SDL_bool draw_end) { if (y1 == y2) { - //HLINE(Uint8, DRAW_FASTSETPIXEL1, draw_end); int length; int pitch = (dst->pitch / dst->format->BytesPerPixel); Uint8 *pixel; diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 21ff1a9ae..78f6ca1e9 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -39,6 +39,7 @@ 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); @@ -54,6 +55,7 @@ static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, 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); @@ -109,9 +111,13 @@ SW_ActivateRenderer(SDL_Renderer * renderer) data->surface = data->window; } if (!data->surface) { - data->surface = data->window = SDL_GetWindowSurface(renderer->window); + SDL_Surface *surface = SDL_GetWindowSurface(renderer->window); + if (surface) { + data->surface = data->window = surface; - SW_UpdateViewport(renderer); + SW_UpdateViewport(renderer); + SW_UpdateClipRect(renderer); + } } return data->surface; } @@ -142,6 +148,7 @@ SW_CreateRendererForSurface(SDL_Surface * surface) data->surface = surface; renderer->WindowEvent = SW_WindowEvent; + renderer->GetOutputSize = SW_GetOutputSize; renderer->CreateTexture = SW_CreateTexture; renderer->SetTextureColorMod = SW_SetTextureColorMod; renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod; @@ -151,6 +158,7 @@ SW_CreateRendererForSurface(SDL_Surface * surface) 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; @@ -192,6 +200,25 @@ SW_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } } +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) { @@ -311,15 +338,27 @@ SW_UpdateViewport(SDL_Renderer * renderer) return 0; } - if (!renderer->viewport.w && !renderer->viewport.h) { - /* There may be no window, so update the viewport directly */ - renderer->viewport.w = surface->w; - renderer->viewport.h = surface->h; - } 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) { diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c index 2eae0393f..b31553587 100644 --- a/src/render/software/SDL_rotate.c +++ b/src/render/software/SDL_rotate.c @@ -398,7 +398,7 @@ SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int ce /* Determine target size */ - //_rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, &dstwidth, &dstheight, &cangle, &sangle); + /*_rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, &dstwidth, &dstheight, &cangle, &sangle); */ /* * Calculate target factors from sin/cos and zoom @@ -459,7 +459,7 @@ SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int ce /* * Turn on source-alpha support */ - //SDL_SetAlpha(rz_dst, SDL_SRCALPHA, 255); + /*SDL_SetAlpha(rz_dst, SDL_SRCALPHA, 255);*/ SDL_SetColorKey(rz_dst, /*SDL_SRCCOLORKEY*/ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src)); } else { /* diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index 9079387cd..0cd440549 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -31,9 +31,12 @@ static size_t SDL_envmemlen = 0; /* Put a variable into the environment */ -#ifdef SDL_setenv -#undef SDL_setenv -int SDL_setenv(const char *name, const char *value, int overwrite) { return SDL_setenv_inline(name, value, overwrite); } +#if defined(HAVE_SETENV) +int +SDL_setenv(const char *name, const char *value, int overwrite) +{ + return setenv(name, value, overwrite); +} #elif defined(__WIN32__) int SDL_setenv(const char *name, const char *value, int overwrite) @@ -143,9 +146,12 @@ SDL_setenv(const char *name, const char *value, int overwrite) #endif /* Retrieve a variable named "name" from the environment */ -#ifdef SDL_getenv -#undef SDL_getenv -char *SDL_getenv(const char *name) { return SDL_getenv_inline(name); } +#if defined(HAVE_GETENV) +char * +SDL_getenv(const char *name) +{ + return getenv(name); +} #elif defined(__WIN32__) char * SDL_getenv(const char *name) diff --git a/src/stdlib/SDL_iconv.c b/src/stdlib/SDL_iconv.c index 4e5e51d87..109e03ed6 100644 --- a/src/stdlib/SDL_iconv.c +++ b/src/stdlib/SDL_iconv.c @@ -364,7 +364,7 @@ SDL_iconv(SDL_iconv_t cd, */ ch = UNKNOWN_UNICODE; } else { - if (p[0] == 0xFC) { + if (p[0] == 0xFC && srclen > 1 && (p[1] & 0xFC) == 0x80) { overlong = SDL_TRUE; } ch = (Uint32) (p[0] & 0x01); @@ -377,7 +377,7 @@ SDL_iconv(SDL_iconv_t cd, */ ch = UNKNOWN_UNICODE; } else { - if (p[0] == 0xF8) { + if (p[0] == 0xF8 && srclen > 1 && (p[1] & 0xF8) == 0x80) { overlong = SDL_TRUE; } ch = (Uint32) (p[0] & 0x03); @@ -390,7 +390,7 @@ SDL_iconv(SDL_iconv_t cd, */ ch = UNKNOWN_UNICODE; } else { - if (p[0] == 0xF0) { + if (p[0] == 0xF0 && srclen > 1 && (p[1] & 0xF0) == 0x80) { overlong = SDL_TRUE; } ch = (Uint32) (p[0] & 0x07); @@ -403,7 +403,7 @@ SDL_iconv(SDL_iconv_t cd, */ ch = UNKNOWN_UNICODE; } else { - if (p[0] == 0xE0) { + if (p[0] == 0xE0 && srclen > 1 && (p[1] & 0xE0) == 0x80) { overlong = SDL_TRUE; } ch = (Uint32) (p[0] & 0x0F); diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c index 65d1e1d16..7a85a3b49 100644 --- a/src/stdlib/SDL_malloc.c +++ b/src/stdlib/SDL_malloc.c @@ -24,16 +24,27 @@ #include "SDL_stdinc.h" -#ifdef SDL_malloc -/* expose the symbol, but use what we figured out elsewhere. */ -#undef SDL_malloc -#undef SDL_calloc -#undef SDL_realloc -#undef SDL_free -void *SDL_malloc(size_t size) { return SDL_malloc_inline(size); } -void *SDL_calloc(size_t nmemb, size_t size) { return SDL_calloc_inline(nmemb, size); } -void *SDL_realloc(void *ptr, size_t size) { return SDL_realloc_inline(ptr, size); } -void SDL_free(void *ptr) { SDL_free_inline(ptr); } +#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. :) */ @@ -409,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 @@ -619,12 +630,12 @@ DEFAULT_MMAP_THRESHOLD default: 256K #define MALLINFO_FIELD_TYPE size_t #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 @@ -5239,7 +5250,7 @@ History: 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 */ diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c index 8c73419c9..0130d5a3b 100644 --- a/src/stdlib/SDL_qsort.c +++ b/src/stdlib/SDL_qsort.c @@ -51,12 +51,11 @@ #include "SDL_stdinc.h" #include "SDL_assert.h" -#ifdef SDL_qsort -#undef SDL_qsort +#if defined(HAVE_QSORT) void SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)) { - SDL_qsort_inline(base, nmemb, size, compare); + qsort(base, nmemb, size, compare); } #else diff --git a/src/stdlib/SDL_stdlib.c b/src/stdlib/SDL_stdlib.c index 1c19ab72f..2ee62beee 100644 --- a/src/stdlib/SDL_stdlib.c +++ b/src/stdlib/SDL_stdlib.c @@ -23,24 +23,169 @@ /* This file contains portable stdlib functions for SDL */ #include "SDL_stdinc.h" +#include "../libm/math_libm.h" -/* these are always #defined, make them real symbol in the library, too... */ -#undef SDL_ceil -#undef SDL_abs -#undef SDL_sinf -#undef SDL_cosf -#undef SDL_isdigit -#undef SDL_isspace -#undef SDL_toupper -#undef SDL_tolower -double SDL_ceil(double x) { return SDL_ceil_inline(x); } -float SDL_cosf(float x) { return SDL_cosf_inline(x); } -float SDL_sinf(float x) { return SDL_sinf_inline(x); } -int SDL_abs(int x) { return SDL_abs_inline(x); } -int SDL_isdigit(int x) { return SDL_isdigit_inline(x); } -int SDL_isspace(int x) { return SDL_isspace_inline(x); } -int SDL_toupper(int x) { return SDL_toupper_inline(x); } -int SDL_tolower(int x) { return SDL_tolower_inline(x); } + +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 @@ -191,7 +336,7 @@ _allmul() pop esi pop edi pop ebp - ret + ret 10h } /* *INDENT-ON* */ } diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index da02d8b09..89f5f358e 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -24,17 +24,6 @@ #include "SDL_stdinc.h" -/* these are always #defined, make them real symbol in the library, too... */ -#undef SDL_itoa -#undef SDL_uitoa -#undef SDL_atoi -#undef SDL_atof -char *SDL_itoa(int value, char *str, int radix) { return SDL_itoa_inline(value, str, radix); } -char *SDL_uitoa(unsigned int value, char *str, int radix) { return SDL_uitoa_inline(value, str, radix); } -int SDL_atoi(const char *str) { return SDL_atoi_inline(str); } -double SDL_atof(const char *str) { return SDL_atof_inline(str); } - - #define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F')) #define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f')) @@ -54,7 +43,7 @@ static int UTF8_TrailingBytes(unsigned char c) return 0; } -#if !defined(SDL_sscanf) || !defined(SDL_strtol) +#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOL) static size_t SDL_ScanLong(const char *text, int radix, long *valuep) { @@ -95,7 +84,7 @@ SDL_ScanLong(const char *text, int radix, long *valuep) } #endif -#if !defined(SDL_sscanf) || !defined(SDL_strtoul) || !defined(SDL_strtod) +#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) static size_t SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *valuep) { @@ -127,7 +116,7 @@ SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *valuep) } #endif -#ifndef SDL_sscanf +#ifndef HAVE_SSCANF static size_t SDL_ScanUintPtrT(const char *text, int radix, uintptr_t * valuep) { @@ -159,7 +148,7 @@ SDL_ScanUintPtrT(const char *text, int radix, uintptr_t * valuep) } #endif -#if !defined(SDL_sscanf) || !defined(SDL_strtoll) +#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOLL) static size_t SDL_ScanLongLong(const char *text, int radix, Sint64 * valuep) { @@ -200,7 +189,7 @@ SDL_ScanLongLong(const char *text, int radix, Sint64 * valuep) } #endif -#if !defined(SDL_sscanf) || !defined(SDL_strtoull) +#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOULL) static size_t SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 * valuep) { @@ -232,7 +221,7 @@ SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 * valuep) } #endif -#if !defined(SDL_sscanf) || !defined(SDL_strtod) +#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOD) static size_t SDL_ScanFloat(const char *text, double *valuep) { @@ -268,14 +257,12 @@ SDL_ScanFloat(const char *text, double *valuep) } #endif - -#ifdef SDL_memset -#undef SDL_memset -void *SDL_memset(void *dst, int c, size_t len) { return SDL_memset_inline(dst, c, len); } -#else 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); Uint32 *dstp4; Uint8 *dstp1; @@ -299,51 +286,68 @@ SDL_memset(void *dst, int c, size_t len) } return dst; +#endif /* HAVE_MEMSET */ } -#endif - -#ifdef SDL_memcpy -#undef SDL_memcpy -void *SDL_memcpy(void *dst, const void *src, size_t len) { return SDL_memcpy_inline(dst, src, len); } -#else void * SDL_memcpy(void *dst, const void *src, size_t len) { - 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++; - } - +#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; -} -#endif - - -#ifdef SDL_memmove -#undef SDL_memmove -void *SDL_memmove(void *dst, const void *src, size_t len) { return SDL_memmove_inline(dst, src, len); } #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__ */ +} + void * SDL_memmove(void *dst, const void *src, size_t len) { +#if defined(HAVE_MEMMOVE) + return memmove(dst, src, len); +#else char *srcp = (char *) src; char *dstp = (char *) dst; @@ -359,16 +363,15 @@ SDL_memmove(void *dst, const void *src, size_t len) } } return dst; +#endif /* HAVE_MEMMOVE */ } -#endif -#ifdef SDL_memcmp -#undef SDL_memcmp -int SDL_memcmp(const void *s1, const void *s2, size_t len) { return SDL_memcmp_inline(s1, s2, len); } -#else int SDL_memcmp(const void *s1, const void *s2, size_t len) { +#if defined(HAVE_MEMCMP) + return memcmp(s1, s2, len); +#else char *s1p = (char *) s1; char *s2p = (char *) s2; while (len--) { @@ -379,46 +382,43 @@ SDL_memcmp(const void *s1, const void *s2, size_t len) ++s2p; } return 0; +#endif /* HAVE_MEMCMP */ } -#endif -#ifdef SDL_strlen -#undef SDL_strlen -size_t SDL_strlen(const char *string) { return SDL_strlen_inline(string); } -#else size_t SDL_strlen(const char *string) { +#if defined(HAVE_STRLEN) + return strlen(string); +#else size_t len = 0; while (*string++) { ++len; } return len; +#endif /* HAVE_STRLEN */ } -#endif -#ifdef SDL_wcslen -#undef SDL_wcslen -size_t SDL_wcslen(const wchar_t * string) { return SDL_wcslen_inline(string); } -#else 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 */ } -#endif -#ifdef SDL_wcslcpy -#undef SDL_wcslcpy -size_t SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen) { return SDL_wcslcpy_inline(dst, src, maxlen); } -#else 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); @@ -426,32 +426,30 @@ SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen) dst[len] = '\0'; } return srclen; +#endif /* HAVE_WCSLCPY */ } -#endif -#ifdef SDL_wcslcat -#undef SDL_wcslcat -size_t SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen) { return SDL_wcslcat_inline(dst, src, maxlen); } -#else 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 */ } -#endif -#ifdef SDL_strlcpy -#undef SDL_strlcpy -size_t SDL_strlcpy(char *dst, const char *src, size_t maxlen) { return SDL_strlcpy_inline(dst, src, maxlen); } -#else 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); @@ -459,8 +457,8 @@ SDL_strlcpy(char *dst, const char *src, size_t maxlen) dst[len] = '\0'; } return srclen; +#endif /* HAVE_STRLCPY */ } -#endif size_t SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes) { @@ -494,45 +492,42 @@ size_t SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes) return bytes; } -#ifdef SDL_strlcat -#undef SDL_strlcat -size_t SDL_strlcat(char *dst, const char *src, size_t maxlen) { return SDL_strlcat_inline(dst, src, maxlen); } -#else 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); } return dstlen + srclen; +#endif /* HAVE_STRLCAT */ } -#endif -#ifdef SDL_strdup -#undef SDL_strdup -char *SDL_strdup(const char *string) { return SDL_strdup_inline(string); } -#else char * SDL_strdup(const char *string) { +#if defined(HAVE_STRDUP) + return strdup(string); +#else size_t len = SDL_strlen(string) + 1; char *newstr = SDL_malloc(len); if (newstr) { SDL_strlcpy(newstr, string, len); } return newstr; +#endif /* HAVE_STRDUP */ } -#endif -#ifdef SDL_strrev -#undef SDL_strrev -char *SDL_strrev(char *string) { return SDL_strrev_inline(string); } -#else 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]; @@ -543,48 +538,47 @@ SDL_strrev(char *string) *b-- = c; } return string; +#endif /* HAVE__STRREV */ } -#endif -#ifdef SDL_strupr -#undef SDL_strupr -char *SDL_strupr(char *string) { return SDL_strupr_inline(string); } -#else char * SDL_strupr(char *string) { +#if defined(HAVE__STRUPR) + return _strupr(string); +#else char *bufp = string; while (*bufp) { *bufp = SDL_toupper((unsigned char) *bufp); ++bufp; } return string; +#endif /* HAVE__STRUPR */ } -#endif -#ifdef SDL_strlwr -#undef SDL_strlwr -char *SDL_strlwr(char *string) { return SDL_strlwr_inline(string); } -#else char * SDL_strlwr(char *string) { +#if defined(HAVE__STRLWR) + return _strlwr(string); +#else char *bufp = string; while (*bufp) { *bufp = SDL_tolower((unsigned char) *bufp); ++bufp; } return string; +#endif /* HAVE__STRLWR */ } -#endif -#ifdef SDL_strchr -#undef SDL_strchr -char *SDL_strchr(const char *string, int c) { return SDL_strchr_inline(string, c); } -#else char * SDL_strchr(const char *string, int c) { +#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; @@ -592,16 +586,17 @@ SDL_strchr(const char *string, int c) ++string; } return NULL; +#endif /* HAVE_STRCHR */ } -#endif -#ifdef SDL_strrchr -#undef SDL_strrchr -char *SDL_strrchr(const char *string, int c) { return SDL_strrchr_inline(string, c); } -#else 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) { @@ -610,16 +605,15 @@ SDL_strrchr(const char *string, int c) --bufp; } return NULL; +#endif /* HAVE_STRRCHR */ } -#endif -#ifdef SDL_strstr -#undef SDL_strstr -char *SDL_strstr(const char *haystack, const char *needle) { return SDL_strstr_inline(haystack, needle); } -#else 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) { @@ -628,11 +622,11 @@ SDL_strstr(const char *haystack, const char *needle) ++haystack; } return NULL; +#endif /* HAVE_STRSTR */ } -#endif -#if !defined(SDL_ltoa) || !defined(SDL_lltoa) || \ - !defined(SDL_ultoa) || !defined(SDL_ulltoa) +#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', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', @@ -641,13 +635,32 @@ static const char ntoa_table[] = { }; #endif /* ntoa() conversion table */ -#ifdef SDL_ltoa -#undef SDL_ltoa -char *SDL_ltoa(long value, char *string, int radix) { return SDL_ltoa_inline(value, string, 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) { @@ -672,16 +685,15 @@ SDL_ltoa(long value, char *string, int radix) } return string; +#endif /* HAVE__LTOA */ } -#endif -#ifdef SDL_ultoa -#undef SDL_ultoa -char *SDL_ultoa(unsigned long value, char *string, int radix) { return SDL_ultoa_inline(value, string, radix); } -#else 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) { @@ -698,16 +710,91 @@ SDL_ultoa(unsigned long value, char *string, int radix) SDL_strrev(string); return string; +#endif /* HAVE__ULTOA */ } -#endif -#ifdef SDL_strtol -#undef SDL_strtol -long SDL_strtol(const char *string, char **endp, int base) { return SDL_strtol_inline(string, endp, base); } +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) { + *bufp++ = '-'; + value = -value; + } + if (value) { + while (value > 0) { + *bufp++ = ntoa_table[value % radix]; + value /= radix; + } + } else { + *bufp++ = '0'; + } + *bufp = '\0'; + + /* The numbers went into the string backwards. :) */ + if (*string == '-') { + SDL_strrev(string + 1); + } else { + SDL_strrev(string); + } + + return string; +#endif /* HAVE__I64TOA */ +} + +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) { + *bufp++ = ntoa_table[value % radix]; + value /= radix; + } + } else { + *bufp++ = '0'; + } + *bufp = '\0'; + + /* The numbers went into the string backwards. :) */ + SDL_strrev(string); + + return string; +#endif /* HAVE__UI64TOA */ +} + +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; @@ -724,16 +811,15 @@ SDL_strtol(const char *string, char **endp, int base) *endp = (char *) string + len; } return value; +#endif /* HAVE_STRTOL */ } -#endif -#ifdef SDL_strtoul -#undef SDL_strtoul -unsigned long SDL_strtoul(const char *string, char **endp, int base) { return SDL_strtoul_inline(string, endp, base); } -#else 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; @@ -750,76 +836,15 @@ SDL_strtoul(const char *string, char **endp, int base) *endp = (char *) string + len; } return value; +#endif /* HAVE_STRTOUL */ } -#endif -#ifdef SDL_lltoa -#undef SDL_lltoa -char *SDL_lltoa(Sint64 value, char *string, int radix) { return SDL_lltoa_inline(value, string, radix); } -#else -char * -SDL_lltoa(Sint64 value, char *string, int radix) -{ - char *bufp = string; - - if (value < 0) { - *bufp++ = '-'; - value = -value; - } - if (value) { - while (value > 0) { - *bufp++ = ntoa_table[value % radix]; - value /= radix; - } - } else { - *bufp++ = '0'; - } - *bufp = '\0'; - - /* The numbers went into the string backwards. :) */ - if (*string == '-') { - SDL_strrev(string + 1); - } else { - SDL_strrev(string); - } - - return string; -} -#endif - -#ifdef SDL_ulltoa -#undef SDL_ulltoa -char *SDL_ulltoa(Uint64 value, char *string, int radix) { return SDL_ulltoa_inline(value, string, radix); } -#else -char * -SDL_ulltoa(Uint64 value, char *string, int radix) -{ - char *bufp = string; - - if (value) { - while (value > 0) { - *bufp++ = ntoa_table[value % radix]; - value /= radix; - } - } else { - *bufp++ = '0'; - } - *bufp = '\0'; - - /* The numbers went into the string backwards. :) */ - SDL_strrev(string); - - return string; -} -#endif - -#ifdef SDL_strtoll -#undef SDL_strtoll -Sint64 SDL_strtoll(const char *string, char **endp, int base) { return SDL_strtoll_inline(string, endp, base); } -#else 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; @@ -836,16 +861,15 @@ SDL_strtoll(const char *string, char **endp, int base) *endp = (char *) string + len; } return value; +#endif /* HAVE_STRTOLL */ } -#endif -#ifdef SDL_strtoull -#undef SDL_strtoull -Uint64 SDL_strtoull(const char *string, char **endp, int base) { return SDL_strtoull_inline(string, endp, base); } -#else 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; @@ -862,16 +886,15 @@ SDL_strtoull(const char *string, char **endp, int base) *endp = (char *) string + len; } return value; +#endif /* HAVE_STRTOULL */ } -#endif -#ifdef SDL_strtod -#undef SDL_strtod -double SDL_strtod(const char *string, char **endp) { return SDL_strtod_inline(string, endp); } -#else double SDL_strtod(const char *string, char **endp) { +#if defined(HAVE_STRTOD) + return strtod(string, endp); +#else size_t len; double value; @@ -880,16 +903,15 @@ SDL_strtod(const char *string, char **endp) *endp = (char *) string + len; } return value; +#endif /* HAVE_STRTOD */ } -#endif -#ifdef SDL_strcmp -#undef SDL_strcmp -int SDL_strcmp(const char *str1, const char *str2) { return SDL_strcmp_inline(str1, str2); } -#else int SDL_strcmp(const char *str1, const char *str2) { +#if defined(HAVE_STRCMP) + return strcmp(str1, str2); +#else while (*str1 && *str2) { if (*str1 != *str2) break; @@ -897,16 +919,15 @@ SDL_strcmp(const char *str1, const char *str2) ++str2; } return (int) ((unsigned char) *str1 - (unsigned char) *str2); +#endif /* HAVE_STRCMP */ } -#endif -#ifdef SDL_strncmp -#undef SDL_strncmp -int SDL_strncmp(const char *str1, const char *str2, size_t maxlen) { return SDL_strncmp_inline(str1, str2, maxlen); } -#else int SDL_strncmp(const char *str1, const char *str2, size_t maxlen) { +#if defined(HAVE_STRNCMP) + return strncmp(str1, str2, maxlen); +#else while (*str1 && *str2 && maxlen) { if (*str1 != *str2) break; @@ -918,39 +939,41 @@ SDL_strncmp(const char *str1, const char *str2, size_t maxlen) return 0; } return (int) ((unsigned char) *str1 - (unsigned char) *str2); +#endif /* HAVE_STRNCMP */ } -#endif -#ifdef SDL_strcasecmp -#undef SDL_strcasecmp -int SDL_strcasecmp(const char *str1, const char *str2) { return SDL_strcasecmp_inline(str1, str2); } -#else 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); + a = SDL_toupper((unsigned char) *str1); + b = SDL_toupper((unsigned char) *str2); if (a != b) break; ++str1; ++str2; } - a = SDL_tolower(*str1); - b = SDL_tolower(*str2); + a = SDL_toupper(*str1); + b = SDL_toupper(*str2); return (int) ((unsigned char) a - (unsigned char) b); +#endif /* HAVE_STRCASECMP */ } -#endif -#ifdef SDL_strncasecmp -#undef SDL_strncasecmp -int SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen) { return SDL_strncasecmp_inline(str1, str2, maxlen); } -#else 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) { @@ -969,11 +992,10 @@ SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen) b = SDL_tolower((unsigned char) *str2); return (int) ((unsigned char) a - (unsigned char) b); } +#endif /* HAVE_STRNCASECMP */ } -#endif -#ifdef SDL_sscanf -#undef SDL_sscanf +#ifdef HAVE_SSCANF int SDL_sscanf(const char *text, const char *fmt, ...) { @@ -1079,8 +1101,7 @@ SDL_sscanf(const char *text, const char *fmt, ...) ++index; } if (text[index] == '0') { - if (SDL_tolower((unsigned char) text[index + 1]) - == 'x') { + if (SDL_tolower((unsigned char) text[index + 1]) == 'x') { radix = 16; } else { radix = 8; @@ -1250,12 +1271,8 @@ SDL_sscanf(const char *text, const char *fmt, ...) return retval; } -#endif +#endif /* HAVE_SSCANF */ -/* just undef; the headers only define this to snprintf because of varargs. */ -#ifdef SDL_snprintf -#undef SDL_snprintf -#endif int SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...) { @@ -1269,137 +1286,196 @@ SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...) return retval; } -#ifdef SDL_vsnprintf -#undef SDL_vsnprintf -int SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap) { return SDL_vsnprintf_inline(text, maxlen, fmt, ap); } +#ifdef HAVE_VSNPRINTF +int SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap) +{ + return vsnprintf(text, maxlen, fmt, ap); +} #else -static size_t -SDL_PrintLong(char *text, long value, int radix, size_t maxlen) + /* FIXME: implement more of the format specifiers */ +typedef struct { - char num[130]; - size_t size; + 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; - SDL_ltoa(value, num, radix); - size = SDL_strlen(num); - if (size >= maxlen) { - size = maxlen - 1; +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) +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); } static size_t -SDL_PrintLongLong(char *text, Sint64 value, int radix, size_t maxlen) +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) +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); - - return size; + SDL_lltoa(value, num, info ? info->radix : 10); + return SDL_PrintString(text, maxlen, info, num); } static size_t -SDL_PrintFloat(char *text, double arg, size_t maxlen) +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); +} + +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) { /* 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 (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); + 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) { + if (left > 1) { + *text = '.'; + --left; + } + ++text; + while (info->precision-- > 0) { value = (unsigned long) (arg * mult); - len = SDL_PrintUnsignedLong(text, value, 10, maxlen); + len = SDL_PrintUnsignedLong(text, left, NULL, value); text += len; - maxlen -= len; + 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) { + size_t left = maxlen; char *textstart = text; - if (maxlen <= 0) { - return 0; - } - --maxlen; /* For the trailing '\0' */ - while (*fmt && maxlen) { + + while (*fmt) { if (*fmt == '%') { SDL_bool done = SDL_FALSE; size_t len = 0; - SDL_bool do_lowercase = SDL_FALSE; - int radix = 10; + SDL_bool check_flag; + SDL_FormatInfo info; enum { DO_INT, @@ -1407,21 +1483,59 @@ SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap) 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 '%': - *text = '%'; + 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); + if (left > 1) { + *text = (char) va_arg(ap, int); + } len = 1; done = SDL_TRUE; break; @@ -1443,78 +1557,62 @@ SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap) case 'd': switch (inttype) { case DO_INT: - len = - SDL_PrintLong(text, - (long) va_arg(ap, int), - radix, maxlen); + len = SDL_PrintLong(text, left, &info, + (long) va_arg(ap, int)); break; case DO_LONG: - len = - SDL_PrintLong(text, va_arg(ap, long), - radix, maxlen); + len = SDL_PrintLong(text, left, &info, + va_arg(ap, long)); break; case DO_LONGLONG: - len = - SDL_PrintLongLong(text, - va_arg(ap, Sint64), - radix, maxlen); + len = SDL_PrintLongLong(text, left, &info, + va_arg(ap, Sint64)); break; } done = SDL_TRUE; break; case 'p': case 'x': - do_lowercase = SDL_TRUE; + info.do_lowercase = SDL_TRUE; /* Fall through to 'X' handling */ case 'X': - if (radix == 10) { - radix = 16; + if (info.radix == 10) { + info.radix = 16; } if (*fmt == 'p') { inttype = DO_LONG; } /* Fall through to unsigned handling */ case 'o': - if (radix == 10) { - radix = 8; + 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, (unsigned long) - va_arg(ap, - unsigned - int), - radix, maxlen); + len = SDL_PrintUnsignedLong(text, left, &info, + (unsigned long) + va_arg(ap, unsigned int)); break; case DO_LONG: - len = - SDL_PrintUnsignedLong(text, - va_arg(ap, - unsigned - long), - radix, maxlen); + len = SDL_PrintUnsignedLong(text, left, &info, + va_arg(ap, unsigned long)); break; case DO_LONGLONG: - len = - SDL_PrintUnsignedLongLong(text, - va_arg(ap, - Uint64), - radix, maxlen); + len = SDL_PrintUnsignedLongLong(text, left, &info, + va_arg(ap, Uint64)); break; } - if (do_lowercase) { - SDL_strlwr(text); - } done = SDL_TRUE; break; case 'f': - len = SDL_PrintFloat(text, va_arg(ap, double), maxlen); + len = SDL_PrintFloat(text, left, &info, va_arg(ap, double)); done = SDL_TRUE; break; case 's': - len = SDL_PrintString(text, va_arg(ap, char *), maxlen); + len = SDL_PrintString(text, left, &info, va_arg(ap, char *)); done = SDL_TRUE; break; default: @@ -1524,16 +1622,25 @@ SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap) ++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'; - + 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 index 4896bc0e5..41a3df68f 100644 --- a/src/test/SDL_test_assert.c +++ b/src/test/SDL_test_assert.c @@ -21,7 +21,7 @@ /* - Used by the test framework and test cases. + Used by the test framework and test cases. */ @@ -47,16 +47,16 @@ static Uint32 SDLTest_AssertsPassed = 0; 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))); + 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))); } /* @@ -65,27 +65,27 @@ void SDLTest_Assert(int assertCondition, const char *assertDescription, ...) 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"); - } + char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH]; - return assertCondition; + /* 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; } /* @@ -94,17 +94,17 @@ int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...) 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"); + 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"); } /* @@ -112,25 +112,25 @@ void SDLTest_AssertPass(const char *assertDescription, ...) */ void SDLTest_ResetAssertSummary() { - SDLTest_AssertsPassed = 0; - SDLTest_AssertsFailed = 0; + SDLTest_AssertsPassed = 0; + SDLTest_AssertsFailed = 0; } /* - * Logs summary of all assertions (total, pass, fail) since last reset + * 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); - } + 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); + } } /* @@ -138,13 +138,13 @@ void SDLTest_LogAssertSummary() */ 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; - } - } + 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 index e050de735..14add55b2 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -27,7 +27,7 @@ #include #define VIDEO_USAGE \ -"[--video driver] [--renderer driver] [--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] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab]" +"[--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]" @@ -74,6 +74,7 @@ SDLTest_CommonCreateState(char **argv, Uint32 flags) state->gl_multisamplesamples = 0; state->gl_retained_backing = 1; state->gl_accelerated = -1; + state->gl_debug = 0; return state; } @@ -99,6 +100,10 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index) 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]) { @@ -296,6 +301,33 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index) 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]) { @@ -405,7 +437,7 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index) return -1; } if (SDL_strcmp(argv[index], "-NSDocumentRevisionsDebugMode") == 0) { - /* Debug flag sent by Xcode */ + /* Debug flag sent by Xcode */ return 2; } return 0; @@ -656,6 +688,9 @@ SDLTest_CommonInit(SDLTest_CommonState * state) 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; @@ -841,6 +876,11 @@ SDLTest_CommonInit(SDLTest_CommonState * state) 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; @@ -890,9 +930,9 @@ SDLTest_CommonInit(SDLTest_CommonState * state) static void SDLTest_PrintEvent(SDL_Event * event) { - if (event->type == SDL_MOUSEMOTION) { - /* Mouse motion is really spammy */ - //return; + if ((event->type == SDL_MOUSEMOTION) || (event->type == SDL_FINGERMOTION)) { + /* Mouse and finger motion are really spammy */ + return; } fprintf(stderr, "SDL EVENT: "); @@ -1049,6 +1089,17 @@ SDLTest_PrintEvent(SDL_Event * event) 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; @@ -1097,10 +1148,33 @@ SDLTest_ScreenShot(SDL_Renderer *renderer) } } +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); @@ -1109,32 +1183,14 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) switch (event->type) { case SDL_WINDOWEVENT: switch (event->window.event) { - case SDL_WINDOWEVENT_SIZE_CHANGED: + case SDL_WINDOWEVENT_CLOSE: { SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); if (window) { - for (i = 0; i < state->num_windows; ++i) { - if (window == state->windows[i] && - (state->window_flags & SDL_WINDOW_RESIZABLE)) { - SDL_Rect viewport; - - viewport.x = 0; - viewport.y = 0; - SDL_GetWindowSize(window, &viewport.w, &viewport.h); - SDL_RenderSetViewport(state->renderers[i], &viewport); - } - } + SDL_DestroyWindow(window); } } break; - case SDL_WINDOWEVENT_CLOSE: - { - SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); - if (window) { - SDL_DestroyWindow(window); - } - } - break; } break; case SDL_KEYDOWN: @@ -1153,7 +1209,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) break; case SDLK_EQUALS: if (event->key.keysym.mod & KMOD_CTRL) { - /* Ctrt-+ double the size of the window */ + /* Ctrl-+ double the size of the window */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); if (window) { int w, h; @@ -1164,7 +1220,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) break; case SDLK_MINUS: if (event->key.keysym.mod & KMOD_CTRL) { - /* Ctrt-- double the size of the window */ + /* Ctrl-- half the size of the window */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); if (window) { int w, h; @@ -1179,6 +1235,26 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) 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) { @@ -1197,7 +1273,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) /* Ctrl-G toggle grab */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); if (window) { - SDL_SetWindowGrab(window, !SDL_GetWindowGrab(window)); + SDL_SetWindowGrab(window, !SDL_GetWindowGrab(window) ? SDL_TRUE : SDL_FALSE); } } break; @@ -1218,7 +1294,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) case SDLK_r: if (event->key.keysym.mod & KMOD_CTRL) { /* Ctrl-R toggle mouse relative mode */ - SDL_SetRelativeMouseMode(!SDL_GetRelativeMouseMode()); + SDL_SetRelativeMouseMode(!SDL_GetRelativeMouseMode() ? SDL_TRUE : SDL_FALSE); } break; case SDLK_z: @@ -1242,6 +1318,17 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) 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: @@ -1250,20 +1337,39 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) 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); + const SDL_bool b = ((flags & SDL_WINDOW_BORDERLESS) != 0) ? SDL_TRUE : SDL_FALSE; SDL_SetWindowBordered(window, b); } } break; - case SDLK_1: + 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; } @@ -1271,6 +1377,9 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) case SDL_QUIT: *done = 1; break; + case SDL_MOUSEMOTION: + lastEvent = event->motion; + break; } } diff --git a/src/test/SDL_test_compare.c b/src/test/SDL_test_compare.c index e7ac424d9..33f237311 100644 --- a/src/test/SDL_test_compare.c +++ b/src/test/SDL_test_compare.c @@ -22,7 +22,7 @@ /* Based on automated SDL_Surface tests originally written by Edgar Simo 'bobbens'. - + Rewritten for test lib by Andreas Schiffler. */ @@ -62,7 +62,7 @@ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, if (allowable_error<0) { allowable_error = 0; } - + SDL_LockSurface( surface ); SDL_LockSurface( referenceSurface ); @@ -82,7 +82,7 @@ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, 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++; diff --git a/src/test/SDL_test_crc32.c b/src/test/SDL_test_crc32.c index 5329319e6..d6685c347 100644 --- a/src/test/SDL_test_crc32.c +++ b/src/test/SDL_test_crc32.c @@ -21,7 +21,7 @@ /* - Used by the test execution component. + Used by the test execution component. Original source code contributed by A. Schiffler for GSOC project. */ @@ -39,10 +39,10 @@ int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext) /* Sanity check context pointer */ if (crcContext==NULL) { return -1; - } - + } + /* - * Build auxiliary table for parallel byte-at-a-time CRC-32 + * Build auxiliary table for parallel byte-at-a-time CRC-32 */ #ifdef ORIGINAL_METHOD for (i = 0; i < 256; ++i) { @@ -64,7 +64,7 @@ int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext) crcContext->crc32_table[i] = c; } #endif - + return 0; } @@ -75,15 +75,15 @@ int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUin 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; } @@ -95,10 +95,10 @@ int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32) if (crcContext==NULL) { *crc32=0; return -1; - } + } /* - * Preload shift register, per CRC-32 spec + * Preload shift register, per CRC-32 spec */ *crc32 = 0xffffffff; @@ -113,10 +113,10 @@ int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32) if (crcContext==NULL) { *crc32=0; return -1; - } - + } + /* - * Return complement, per CRC-32 spec + * Return complement, per CRC-32 spec */ *crc32 = (~(*crc32)); @@ -134,24 +134,24 @@ int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, *crc32=0; return -1; } - + if (inBuf==NULL) { return -1; } /* - * Calculate CRC from data + * Calculate CRC from data */ crc = *crc32; for (p = inBuf; inLen > 0; ++p, --inLen) { -#ifdef ORIGINAL_METHOD +#ifdef ORIGINAL_METHOD crc = (crc << 8) ^ crcContext->crc32_table[(crc >> 24) ^ *p]; #else crc = ((crc >> 8) & 0x00FFFFFF) ^ crcContext->crc32_table[ (crc ^ *p) & 0xFF ]; -#endif - } +#endif + } *crc32 = crc; - + return 0; } @@ -159,7 +159,7 @@ 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 index dcb3f0464..144bcad02 100644 --- a/src/test/SDL_test_font.c +++ b/src/test/SDL_test_font.c @@ -32,3077 +32,3077 @@ 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 */ + /* + * 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 */ }; @@ -3116,123 +3116,123 @@ 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; + 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 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; + /* + * Setup destination rectangle + */ + drect.x = x; + drect.y = y; + drect.w = charWidth; + drect.h = charHeight; - /* Character index in cache */ - ci = (unsigned char)c; + /* 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); - } + /* + * 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; + 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; - } + /* + * 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); + /* Convert temp surface into texture */ + SDLTest_CharTextureCache[ci] = SDL_CreateTextureFromSurface(renderer, character); + SDL_FreeSurface(character); - /* - * Check pointer - */ - if (SDLTest_CharTextureCache[ci] == NULL) { - return (-1); - } - } + /* + * 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); + /* + * 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); + /* + * Draw texture onto destination + */ + result |= SDL_RenderCopy(renderer, SDLTest_CharTextureCache[ci], &srect, &drect); - return (result); + 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; + 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++; - } + while (*curchar && !result) { + result |= SDLTest_DrawCharacter(renderer, curx, cury, *curchar); + curx += charWidth; + curchar++; + } - return (result); + return (result); } diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c index 89b669157..8a27fd011 100644 --- a/src/test/SDL_test_fuzzer.c +++ b/src/test/SDL_test_fuzzer.c @@ -19,10 +19,10 @@ 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" @@ -43,7 +43,7 @@ #include "SDL_test.h" -/** +/** * Counter for fuzzer invocations */ static int fuzzerInvocationCounter = 0; @@ -60,93 +60,93 @@ static SDLTest_RandomContext rndContext; 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; + 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; + return fuzzerInvocationCounter; } Uint8 SDLTest_RandomUint8() { - fuzzerInvocationCounter++; + fuzzerInvocationCounter++; - return (Uint8) SDLTest_RandomInt(&rndContext) & 0x000000FF; + return (Uint8) SDLTest_RandomInt(&rndContext) & 0x000000FF; } Sint8 SDLTest_RandomSint8() { - fuzzerInvocationCounter++; + fuzzerInvocationCounter++; - return (Sint8) SDLTest_RandomInt(&rndContext) & 0x000000FF; + return (Sint8) SDLTest_RandomInt(&rndContext) & 0x000000FF; } Uint16 SDLTest_RandomUint16() { - fuzzerInvocationCounter++; + fuzzerInvocationCounter++; - return (Uint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF; + return (Uint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF; } Sint16 SDLTest_RandomSint16() { - fuzzerInvocationCounter++; + fuzzerInvocationCounter++; - return (Sint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF; + return (Sint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF; } Sint32 SDLTest_RandomSint32() { - fuzzerInvocationCounter++; + fuzzerInvocationCounter++; - return (Sint32) SDLTest_RandomInt(&rndContext); + return (Sint32) SDLTest_RandomInt(&rndContext); } Uint32 SDLTest_RandomUint32() { - fuzzerInvocationCounter++; + fuzzerInvocationCounter++; - return (Uint32) SDLTest_RandomInt(&rndContext); + return (Uint32) SDLTest_RandomInt(&rndContext); } Uint64 SDLTest_RandomUint64() { - Uint64 value = 0; - Uint32 *vp = (void *)&value; + Uint64 value = 0; + Uint32 *vp = (void *)&value; - fuzzerInvocationCounter++; + fuzzerInvocationCounter++; - vp[0] = SDLTest_RandomSint32(); - vp[1] = SDLTest_RandomSint32(); + vp[0] = SDLTest_RandomSint32(); + vp[1] = SDLTest_RandomSint32(); - return value; + return value; } Sint64 SDLTest_RandomSint64() { - Uint64 value = 0; - Uint32 *vp = (void *)&value; + Uint64 value = 0; + Uint32 *vp = (void *)&value; - fuzzerInvocationCounter++; + fuzzerInvocationCounter++; - vp[0] = SDLTest_RandomSint32(); - vp[1] = SDLTest_RandomSint32(); + vp[0] = SDLTest_RandomSint32(); + vp[1] = SDLTest_RandomSint32(); - return value; + return value; } @@ -154,23 +154,23 @@ SDLTest_RandomSint64() Sint32 SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax) { - Sint64 min = pMin; - Sint64 max = pMax; - Sint64 temp; - Sint64 number; + 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; - } + 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 */ + number = SDLTest_RandomUint32(); + /* invocation count increment in preceeding call */ - return (Sint32)((number % ((max + 1) - min)) + min); + return (Sint32)((number % ((max + 1) - min)) + min); } /*! @@ -189,7 +189,7 @@ SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax) * 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. + * 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) @@ -200,103 +200,107 @@ Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) { Uint64 b1, b2; - Uint64 delta; - Uint64 tempBuf[4]; - Uint8 index; - + Uint64 delta; + Uint64 tempBuf[4]; + Uint8 index; + /* Maybe swap */ - if (boundary1 > boundary2) { - b1 = boundary2; - b2 = boundary1; - } else { - b1 = boundary1; - b2 = boundary2; + 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++; + 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++; - } + } 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 (b2 < maxValue) { + tempBuf[index] = b2 + 1; + index++; + } + } - if (index == 0) { - /* There are no valid boundaries */ - SDL_Unsupported(); - return 0; - } + if (index == 0) { + /* There are no valid boundaries */ + SDL_Unsupported(); + return 0; + } - return tempBuf[SDLTest_RandomUint8() % index]; + 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); + /* 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); + /* 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 */ - const Uint64 maxValue = ULONG_MAX; - return (Uint32)SDLTest_GenerateUnsignedBoundaryValues(maxValue, - (Uint64) boundary1, (Uint64) boundary2, - 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); + /* max value for Uint64 */ + const Uint64 maxValue = ULLONG_MAX; + return SDLTest_GenerateUnsignedBoundaryValues(maxValue, + (Uint64) boundary1, (Uint64) boundary2, + validDomain); } /*! @@ -315,9 +319,9 @@ SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool v * 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. + * For instance, for Uint8 -> -127, etc. * \param maxValue The biggest value that is acceptable for this data type. - * For instance, for Uint8 -> 127, etc. + * 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) @@ -328,113 +332,118 @@ 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; - + Sint64 delta; + Sint64 tempBuf[4]; + Uint8 index; + /* Maybe swap */ - if (boundary1 > boundary2) { - b1 = boundary2; - b2 = boundary1; - } else { - b1 = boundary1; - b2 = boundary2; + 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++; + 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++; - } + } 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 (b2 < maxValue) { + tempBuf[index] = b2 + 1; + index++; + } + } - if (index == 0) { - /* There are no valid boundaries */ - SDL_Unsupported(); - return minValue; - } + if (index == 0) { + /* There are no valid boundaries */ + SDL_Unsupported(); + return minValue; + } - return tempBuf[SDLTest_RandomUint8() % index]; + 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); + /* 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); + /* 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 */ - const Sint64 maxValue = LONG_MAX; - const Sint64 minValue = LONG_MIN; - return (Sint32)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, - (Sint64) boundary1, (Sint64) boundary2, - 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); + /* 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; + return (float) SDLTest_RandomUint32() / UINT_MAX; } float @@ -446,70 +455,70 @@ SDLTest_RandomFloat() double SDLTest_RandomUnitDouble() { - return (double) (SDLTest_RandomUint64() >> 11) * (1.0/9007199254740992.0); + 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; + 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); + return SDLTest_RandomAsciiStringWithMaximumLength(255); } char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength) { - int size; + int size; - if(maxLength < 1) { + if(maxLength < 1) { SDL_InvalidParamError("maxLength"); - return NULL; - } + return NULL; + } - size = (SDLTest_RandomUint32() % (maxLength + 1)); - - return SDLTest_RandomAsciiStringOfSize(size); + size = (SDLTest_RandomUint32() % (maxLength + 1)); + + return SDLTest_RandomAsciiStringOfSize(size); } char * SDLTest_RandomAsciiStringOfSize(int size) { - char *string; - int counter; + char *string; + int counter; - if(size < 1) { + if(size < 1) { SDL_InvalidParamError("size"); - return NULL; - } + return NULL; + } - string = (char *)SDL_malloc((size + 1) * sizeof(char)); - if (string==NULL) { - 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); - } + for(counter = 0; counter < size; ++counter) { + string[counter] = (char)SDLTest_RandomIntegerInRange(32, 126); + } - string[counter] = '\0'; + string[counter] = '\0'; - fuzzerInvocationCounter++; + fuzzerInvocationCounter++; - return string; + return string; } diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c index fcd2e4f5c..291874566 100644 --- a/src/test/SDL_test_harness.c +++ b/src/test/SDL_test_harness.c @@ -53,45 +53,45 @@ static Uint32 SDLTest_TestCaseTimeout = 3600; char * SDLTest_GenerateRunSeed(const int length) { - char *seed = NULL; - SDLTest_RandomContext randomContext; - int counter; + 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; - } + /* 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; - } + /* 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'; + /* 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; + 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 +* \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. * @@ -99,61 +99,61 @@ SDLTest_GenerateRunSeed(const int length) 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; + 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 (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 (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 (testName == NULL || SDL_strlen(testName)==0) { + SDLTest_LogError("Invalid testName string."); + return -1; + } - if (iteration <= 0) { - SDLTest_LogError("Invalid iteration count."); - 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); + /* 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); + /* 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; + /* 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]; + return keys[0]; } /** @@ -163,52 +163,52 @@ SDLTest_GenerateExecKey(char *runSeed, char *suiteName, char *testName, int iter * * \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; + Uint32 timeoutInMilliseconds; + SDL_TimerID timerID; - if (callback == NULL) { - SDLTest_LogError("Timeout callback can't be NULL"); - return -1; - } + 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; - } + 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; - } - } + /* 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; - } + /* 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; + return timerID; } /** * \brief Timeout handler. Aborts test run and exits harness process. */ void - SDLTest_BailOut() + SDLTest_BailOut() { - SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run."); - exit(TEST_ABORTED); // bail out from the test + SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run."); + exit(TEST_ABORTED); /* bail out from the test */ } /** @@ -223,99 +223,127 @@ void int SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey) { - SDL_TimerID timer = 0; - int testResult = 0; - int fuzzerCount; + 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 (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; - } + if (!testCase->enabled) + { + SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Disabled)"); + return TEST_RESULT_SKIPPED; + } - // Initialize fuzzer - SDLTest_FuzzerInit(execKey); + /* Initialize fuzzer */ + SDLTest_FuzzerInit(execKey); - // Reset assert tracker - SDLTest_ResetAssertSummary(); + /* Reset assert tracker */ + SDLTest_ResetAssertSummary(); - // Set timeout timer - timer = SDLTest_SetTestTimeout(SDLTest_TestCaseTimeout, SDLTest_BailOut); + /* 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; - } - } + /* 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 - testCase->testCase(0x0); - testResult = SDLTest_AssertSummaryToTestResult(); + /* Run test case function */ + testCaseResult = testCase->testCase(0x0); - // Maybe run suite cleanup function (ignore failed asserts) - if (testSuite->testTearDown) { - testSuite->testTearDown(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(); + } - // Cancel timeout timer - if (timer) { - SDL_RemoveTimer(timer); - } + /* Maybe run suite cleanup function (ignore failed asserts) */ + if (testSuite->testTearDown) { + testSuite->testTearDown(0x0); + } - // Report on asserts and fuzzer usage - fuzzerCount = SDLTest_GetFuzzerInvocationCount(); - if (fuzzerCount > 0) { - SDLTest_Log("Fuzzer invocations: %d", fuzzerCount); - } - SDLTest_LogAssertSummary(); + /* Cancel timeout timer */ + if (timer) { + SDL_RemoveTimer(timer); + } - return testResult; + /* 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; + 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 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); - } - } + /* 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; + float currentClock = (float)clock(); + return currentClock / (float)CLOCKS_PER_SEC; } /** @@ -334,274 +362,274 @@ float GetClock() */ 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; + 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; - } + /* 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; - } + /* 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; + /* Reset per-run counters */ + totalTestFailedCount = 0; + totalTestPassedCount = 0; + totalTestSkippedCount = 0; - // Take time - run start - runStartSeconds = GetClock(); + /* Take time - run start */ + runStartSeconds = GetClock(); - // Log run with fuzzer parameters - SDLTest_Log("::::: Test Run /w seed '%s' started\n", runSeed); + /* 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; - } + /* 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; - } - } + /* 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; + } + } + } - // Loop over all suites - suiteCounter = 0; - while(testSuites[suiteCounter]) { - testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter]; - currentSuiteName = (char *)((testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat); - suiteCounter++; + if (suiteFilter == 0 && testFilter == 0) { + SDLTest_LogError("Filter '%s' did not match any test suite/case.", filter); + SDLTest_Log("Exit code: 2"); + return 2; + } + } - // 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 { + /* Loop over all suites */ + suiteCounter = 0; + while(testSuites[suiteCounter]) { + testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter]; + currentSuiteName = (char *)((testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat); + suiteCounter++; - // Reset per-suite counters - testFailedCount = 0; - testPassedCount = 0; - testSkippedCount = 0; + /* 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 { - // Take time - suite start - suiteStartSeconds = GetClock(); + /* Reset per-suite counters */ + testFailedCount = 0; + testPassedCount = 0; + testSkippedCount = 0; - // Log suite started - SDLTest_Log("===== Test Suite %i: '%s' started\n", - suiteCounter, - currentSuiteName); + /* Take time - suite start */ + suiteStartSeconds = GetClock(); - // 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++; + /* Log suite started */ + SDLTest_Log("===== Test Suite %i: '%s' started\n", + suiteCounter, + currentSuiteName); - // 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; - } + /* 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++; - // Take time - test start - testStartSeconds = GetClock(); + /* 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; + } - // 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); - } + /* Take time - test start */ + testStartSeconds = GetClock(); - // Loop over all iterations - iterationCounter = 0; - while(iterationCounter < testIterations) - { - iterationCounter++; + /* 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); + } - if (userExecKey != 0) { - execKey = userExecKey; - } else { - execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter); - } + /* Loop over all iterations */ + iterationCounter = 0; + while(iterationCounter < testIterations) + { + iterationCounter++; - SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey); - testResult = SDLTest_RunTest(testSuite, testCase, execKey); + if (userExecKey != 0) { + execKey = userExecKey; + } else { + execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter); + } - if (testResult == TEST_RESULT_PASSED) { - testPassedCount++; - totalTestPassedCount++; - } else if (testResult == TEST_RESULT_SKIPPED) { - testSkippedCount++; - totalTestSkippedCount++; - } else { - testFailedCount++; - totalTestFailedCount++; - } - } + SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey); + testResult = SDLTest_RunTest(testSuite, testCase, execKey); - // Take time - test end - testEndSeconds = GetClock(); - runtime = testEndSeconds - testStartSeconds; - if (runtime < 0.0f) runtime = 0.0f; + if (testResult == TEST_RESULT_PASSED) { + testPassedCount++; + totalTestPassedCount++; + } else if (testResult == TEST_RESULT_SKIPPED) { + testSkippedCount++; + totalTestSkippedCount++; + } else { + testFailedCount++; + totalTestFailedCount++; + } + } - 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); - } + /* Take time - test end */ + testEndSeconds = GetClock(); + runtime = testEndSeconds - testStartSeconds; + if (runtime < 0.0f) runtime = 0.0f; - // 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; - } + 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); + /* Take time - suite end */ + suiteEndSeconds = GetClock(); + runtime = suiteEndSeconds - suiteStartSeconds; + if (runtime < 0.0f) runtime = 0.0f; - // 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"); - } + /* 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); + /* Take time - run end */ + runEndSeconds = GetClock(); + runtime = runEndSeconds - runStartSeconds; + if (runtime < 0.0f) runtime = 0.0f; - // 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"); - } + /* Log total runtime */ + SDLTest_Log("Total Run runtime: %.1f sec", runtime); - SDLTest_Log("Exit code: %d", runResult); - return runResult; + /* 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 index 2608e4fa8..d1d12952c 100644 --- a/src/test/SDL_test_imageBlit.c +++ b/src/test/SDL_test_imageBlit.c @@ -540,11 +540,11 @@ const SDLTest_SurfaceImage_t SDLTest_imageBlit = { */ SDL_Surface *SDLTest_ImageBlit() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + 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.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. */ @@ -1023,11 +1023,11 @@ const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = { */ SDL_Surface *SDLTest_ImageBlitColor() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + 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.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. */ @@ -1535,10 +1535,10 @@ const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = { */ SDL_Surface *SDLTest_ImageBlitAlpha() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( (void*)SDLTest_imageBlitAlpha.pixel_data, - SDLTest_imageBlitAlpha.width, - SDLTest_imageBlitAlpha.height, + 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) diff --git a/src/test/SDL_test_imageBlitBlend.c b/src/test/SDL_test_imageBlitBlend.c index 8a4859533..06dbfabd4 100644 --- a/src/test/SDL_test_imageBlitBlend.c +++ b/src/test/SDL_test_imageBlitBlend.c @@ -580,11 +580,11 @@ const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = { */ SDL_Surface *SDLTest_ImageBlitBlendAdd() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + 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.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. */ @@ -1110,11 +1110,11 @@ const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { */ SDL_Surface *SDLTest_ImageBlitBlend() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + 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.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. */ @@ -1540,11 +1540,11 @@ const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = { */ SDL_Surface *SDLTest_ImageBlitBlendMod() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + 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.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. */ @@ -2353,11 +2353,11 @@ const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = { */ SDL_Surface *SDLTest_ImageBlitBlendNone() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + 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.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. */ @@ -2821,11 +2821,11 @@ const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = { */ SDL_Surface *SDLTest_ImageBlitBlendAll() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + 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.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. */ diff --git a/src/test/SDL_test_imageFace.c b/src/test/SDL_test_imageFace.c index 2dd7ea762..46c117a4f 100644 --- a/src/test/SDL_test_imageFace.c +++ b/src/test/SDL_test_imageFace.c @@ -223,11 +223,11 @@ const SDLTest_SurfaceImage_t SDLTest_imageFace = { */ SDL_Surface *SDLTest_ImageFace() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + 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.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. */ diff --git a/src/test/SDL_test_imagePrimitives.c b/src/test/SDL_test_imagePrimitives.c index 191353854..93b99d692 100644 --- a/src/test/SDL_test_imagePrimitives.c +++ b/src/test/SDL_test_imagePrimitives.c @@ -490,11 +490,11 @@ const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = { */ SDL_Surface *SDLTest_ImagePrimitives() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( (void*)SDLTest_imagePrimitives.pixel_data, - SDLTest_imagePrimitives.width, + SDLTest_imagePrimitives.width, SDLTest_imagePrimitives.height, - SDLTest_imagePrimitives.bytes_per_pixel * 8, + SDLTest_imagePrimitives.bytes_per_pixel * 8, SDLTest_imagePrimitives.width * SDLTest_imagePrimitives.bytes_per_pixel, #if (SDL_BYTEORDER == SDL_BIG_ENDIAN) 0xff000000, /* Red bit mask. */ diff --git a/src/test/SDL_test_imagePrimitivesBlend.c b/src/test/SDL_test_imagePrimitivesBlend.c index 705e5c9bc..ce9adc51a 100644 --- a/src/test/SDL_test_imagePrimitivesBlend.c +++ b/src/test/SDL_test_imagePrimitivesBlend.c @@ -672,11 +672,11 @@ const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = { */ SDL_Surface *SDLTest_ImagePrimitivesBlend() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( (void*)SDLTest_imagePrimitivesBlend.pixel_data, - SDLTest_imagePrimitivesBlend.width, - SDLTest_imagePrimitivesBlend.height, - SDLTest_imagePrimitivesBlend.bytes_per_pixel * 8, + SDLTest_imagePrimitivesBlend.width, + SDLTest_imagePrimitivesBlend.height, + SDLTest_imagePrimitivesBlend.bytes_per_pixel * 8, SDLTest_imagePrimitivesBlend.width * SDLTest_imagePrimitivesBlend.bytes_per_pixel, #if (SDL_BYTEORDER == SDL_BIG_ENDIAN) 0xff000000, /* Red bit mask. */ diff --git a/src/test/SDL_test_log.c b/src/test/SDL_test_log.c index 4d19012dc..c854c0f7d 100644 --- a/src/test/SDL_test_log.c +++ b/src/test/SDL_test_log.c @@ -21,11 +21,11 @@ /* - Used by the test framework and test cases. + Used by the test framework and test cases. */ -// quiet windows compiler warnings +/* quiet windows compiler warnings */ #define _CRT_SECURE_NO_WARNINGS #include "SDL_config.h" @@ -50,18 +50,19 @@ * * \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02' */ -char *SDLTest_TimestampToString(const time_t timestamp) +char *SDLTest_TimestampToString(const time_t timestamp) { - time_t copy; - static char buffer[64]; - struct tm *local; + 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), "%x %X", local); + SDL_memset(buffer, 0, sizeof(buffer)); + copy = timestamp; + local = localtime(©); + strftime(buffer, sizeof(buffer), fmt, local); - return buffer; + return buffer; } /* @@ -69,17 +70,17 @@ char *SDLTest_TimestampToString(const time_t timestamp) */ void SDLTest_Log(const char *fmt, ...) { - va_list list; - char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH]; + 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); + /* 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); + /* Log with timestamp and newline */ + SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_INFO, " %s: %s", SDLTest_TimestampToString(time(0)), logMessage); } /* @@ -87,15 +88,15 @@ void SDLTest_Log(const char *fmt, ...) */ void SDLTest_LogError(const char *fmt, ...) { - va_list list; - char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH]; + 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); + /* 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); + /* 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 index 6d4d7d04b..3f42ed356 100644 --- a/src/test/SDL_test_md5.c +++ b/src/test/SDL_test_md5.c @@ -102,7 +102,7 @@ static unsigned char MD5PADDING[64] = { (a) += (b); \ } -/* +/* The routine MD5Init initializes the message-digest context mdContext. All fields are set to zero. */ @@ -122,14 +122,14 @@ void SDLTest_Md5Init(SDLTest_Md5Context * mdContext) 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) + unsigned int inLen) { MD5UINT4 in[16]; int mdi; @@ -139,12 +139,12 @@ void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, if (inBuf == NULL || inLen < 1) return; /* - * compute number of bytes mod 64 + * compute number of bytes mod 64 */ mdi = (int) ((mdContext->i[0] >> 3) & 0x3F); /* - * update number of bits + * update number of bits */ if ((mdContext->i[0] + ((MD5UINT4) inLen << 3)) < mdContext->i[0]) mdContext->i[1]++; @@ -153,26 +153,26 @@ void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, while (inLen--) { /* - * add new character to buffer, increment mdi + * add new character to buffer, increment mdi */ mdContext->in[mdi++] = *inBuf++; /* - * transform if necessary + * 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]); + 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]. */ @@ -187,24 +187,24 @@ void SDLTest_Md5Final(SDLTest_Md5Context * mdContext) if (mdContext == NULL) return; /* - * save number of bits + * save number of bits */ in[14] = mdContext->i[0]; in[15] = mdContext->i[1]; /* - * compute number of bytes mod 64 + * compute number of bytes mod 64 */ mdi = (int) ((mdContext->i[0] >> 3) & 0x3F); /* - * pad out to 56 mod 64 + * pad out to 56 mod 64 */ padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); SDLTest_Md5Update(mdContext, MD5PADDING, padLen); /* - * append length in bits and transform + * append length in bits and transform */ for (i = 0, ii = 0; i < 14; i++, ii += 4) in[i] = (((MD5UINT4) mdContext->in[ii + 3]) << 24) | @@ -214,7 +214,7 @@ void SDLTest_Md5Final(SDLTest_Md5Context * mdContext) SDLTest_Md5Transform(mdContext->buf, in); /* - * store buffer in digest + * store buffer in digest */ for (i = 0, ii = 0; i < 4; i++, ii += 4) { mdContext->digest[ii] = (unsigned char) (mdContext->buf[i] & 0xFF); @@ -234,100 +234,100 @@ static void SDLTest_Md5Transform(MD5UINT4 * buf, MD5UINT4 * in) MD5UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; /* - * Round 1 + * 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 */ + 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 + * 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 */ + 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 + * 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 */ + 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 + * 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 */ + 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; diff --git a/src/test/SDL_test_random.c b/src/test/SDL_test_random.c index 8b305c50e..2c70dbd47 100644 --- a/src/test/SDL_test_random.c +++ b/src/test/SDL_test_random.c @@ -23,14 +23,14 @@ A portable "32-bit Multiply with carry" random number generator. - Used by the fuzzer component. + Used by the fuzzer component. Original source code contributed by A. Schiffler for GSOC project. */ #include "SDL_config.h" -#include +#include #include #include @@ -41,13 +41,13 @@ 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 + * 1631296680 2131995753 2083801278 1873196400 1554115554 */ rndContext->a = 1655692410; rndContext->x = 30903; @@ -65,9 +65,9 @@ void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, uns void SDLTest_RandomInitTime(SDLTest_RandomContext * rndContext) { int a, b; - + if (rndContext==NULL) return; - + srand((unsigned int)time(NULL)); a=rand(); srand(clock()); @@ -82,7 +82,7 @@ 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 = diff --git a/src/thread/SDL_systhread.h b/src/thread/SDL_systhread.h index 694ea7f27..738ea27b0 100644 --- a/src/thread/SDL_systhread.h +++ b/src/thread/SDL_systhread.h @@ -50,6 +50,12 @@ extern int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority); */ extern void SDL_SYS_WaitThread(SDL_Thread * thread); +/* Get the thread local storage for this thread */ +extern SDL_TLSData *SDL_SYS_GetTLSData(); + +/* 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 e20f672ff..5eaed0c0c 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -22,158 +22,227 @@ /* 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. + +SDL_TLSID +SDL_TLSCreate() +{ + static SDL_atomic_t SDL_tls_id; + return SDL_AtomicIncRef(&SDL_tls_id)+1; +} + +void * +SDL_TLSGet(SDL_TLSID id) +{ + SDL_TLSData *storage; + + storage = SDL_SYS_GetTLSData(); + if (!storage || id == 0 || id > storage->limit) { + return NULL; + } + return storage->array[id-1].data; +} + +int +SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void *)) +{ + 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_TLSCleanup() +{ + 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); + } +} + + +/* 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. */ -static int SDL_maxthreads = 0; -static int SDL_numthreads = 0; -static SDL_Thread **SDL_Threads = NULL; -static SDL_mutex *thread_lock = NULL; -static int -SDL_ThreadsInit(void) +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() { - int retval; + SDL_threadID thread = SDL_ThreadID(); + SDL_TLSEntry *entry; + SDL_TLSData *storage = NULL; - retval = 0; - thread_lock = SDL_CreateMutex(); - if (thread_lock == NULL) { - retval = -1; - } - return (retval); -} - -/* 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. - */ -#if 0 -static void -SDL_ThreadsQuit(void) -{ - SDL_mutex *mutex; - - mutex = thread_lock; - thread_lock = NULL; - if (mutex != NULL) { - SDL_DestroyMutex(mutex); - } -} -#endif - -/* Routines for manipulating the thread list */ -static void -SDL_AddThread(SDL_Thread * thread) -{ - /* 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; + 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_LockMutex(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); -} - -static void -SDL_DelThread(SDL_Thread * thread) -{ - int i; - - if (!thread_lock) { - return; - } - SDL_LockMutex(thread_lock); - for (i = 0; i < SDL_numthreads; ++i) { - if (thread == SDL_Threads[i]) { + 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; } } - if (i < SDL_numthreads) { - if (--SDL_numthreads > 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_UnlockMutex(SDL_generic_TLS_mutex); -#if 0 /* There could be memory corruption if another thread is starting */ - if (SDL_Threads == NULL) { - SDL_ThreadsQuit(); - } -#endif + 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) { + 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; - errbuf = &SDL_global_error; - if (SDL_Threads) { - int i; - SDL_threadID this_thread; - - this_thread = SDL_ThreadID(); - SDL_LockMutex(thread_lock); - for (i = 0; i < SDL_numthreads; ++i) { - if (this_thread == SDL_Threads[i]->threadid) { - errbuf = &SDL_Threads[i]->errbuf; - break; - } + /* 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_mutexV(thread_lock); + SDL_AtomicUnlock(&tls_lock); } - return (errbuf); + 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; } @@ -194,9 +263,7 @@ SDL_RunThread(void *data) void *userdata = args->data; int *statusloc = &args->info->status; - /* Perform any system-dependent setup - - this function cannot fail, and cannot use SDL_SetError() - */ + /* Perform any system-dependent setup - this function may not fail */ SDL_SYS_SetupThread(args->info->name); /* Get the thread id */ @@ -207,6 +274,9 @@ SDL_RunThread(void *data) /* Run the function */ *statusloc = userfunc(userdata); + + /* Clean up thread-local storage */ + SDL_TLSCleanup(); } #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD @@ -249,7 +319,9 @@ SDL_CreateThread(int (SDLCALL * fn) (void *), args = (thread_args *) SDL_malloc(sizeof(*args)); if (args == NULL) { SDL_OutOfMemory(); - SDL_free(thread->name); + if (thread->name) { + SDL_free(thread->name); + } SDL_free(thread); return (NULL); } @@ -258,15 +330,14 @@ SDL_CreateThread(int (SDLCALL * fn) (void *), args->info = thread; args->wait = SDL_CreateSemaphore(0); if (args->wait == NULL) { - SDL_free(thread->name); + if (thread->name) { + SDL_free(thread->name); + } 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! */ #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD ret = SDL_SYS_CreateThread(thread, args, pfnBeginThread, pfnEndThread); @@ -278,8 +349,9 @@ SDL_CreateThread(int (SDLCALL * fn) (void *), SDL_SemWait(args->wait); } else { /* Oops, failed. Gotta free everything */ - SDL_DelThread(thread); - SDL_free(thread->name); + if (thread->name) { + SDL_free(thread->name); + } SDL_free(thread); thread = NULL; } @@ -306,7 +378,11 @@ SDL_GetThreadID(SDL_Thread * thread) const char * SDL_GetThreadName(SDL_Thread * thread) { - return thread->name; + if (thread) { + return thread->name; + } else { + return NULL; + } } int @@ -323,8 +399,9 @@ SDL_WaitThread(SDL_Thread * thread, int *status) if (status) { *status = thread->status; } - SDL_DelThread(thread); - SDL_free(thread->name); + if (thread->name) { + SDL_free(thread->name); + } SDL_free(thread); } } diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index 4bb519eec..90d9b57ca 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -58,6 +58,30 @@ struct SDL_Thread /* 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_systls.c b/src/thread/beos/SDL_systls.c new file mode 100644 index 000000000..8e941289a --- /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/generic/SDL_syscond.c b/src/thread/generic/SDL_syscond.c index f540cddb6..5c8fe8bd6 100644 --- a/src/thread/generic/SDL_syscond.c +++ b/src/thread/generic/SDL_syscond.c @@ -187,7 +187,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) 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 + 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) { diff --git a/src/thread/generic/SDL_syssem.c b/src/thread/generic/SDL_syssem.c index fc4e1fcc7..bfb011dda 100644 --- a/src/thread/generic/SDL_syssem.c +++ b/src/thread/generic/SDL_syssem.c @@ -32,7 +32,7 @@ SDL_sem * SDL_CreateSemaphore(Uint32 initial_value) { - SDL_SetError("SDL not configured with thread support"); + SDL_SetError("SDL not built with thread support"); return (SDL_sem *) 0; } @@ -44,19 +44,19 @@ SDL_DestroySemaphore(SDL_sem * sem) int SDL_SemTryWait(SDL_sem * sem) { - return SDL_SetError("SDL not configured with thread support"); + return SDL_SetError("SDL not built with thread support"); } int SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) { - return SDL_SetError("SDL not configured with thread support"); + return SDL_SetError("SDL not built with thread support"); } int SDL_SemWait(SDL_sem * sem) { - return SDL_SetError("SDL not configured with thread support"); + return SDL_SetError("SDL not built with thread support"); } Uint32 @@ -68,7 +68,7 @@ SDL_SemValue(SDL_sem * sem) int SDL_SemPost(SDL_sem * sem) { - return SDL_SetError("SDL not configured with thread support"); + return SDL_SetError("SDL not built with thread support"); } #else diff --git a/src/thread/generic/SDL_systhread.c b/src/thread/generic/SDL_systhread.c index deebc64fb..139f8ac03 100644 --- a/src/thread/generic/SDL_systhread.c +++ b/src/thread/generic/SDL_systhread.c @@ -25,8 +25,15 @@ #include "SDL_thread.h" #include "../SDL_systhread.h" +#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 */ { return SDL_SetError("Threads are not supported on this platform"); } diff --git a/src/SDL_fatal.h b/src/thread/generic/SDL_systls.c similarity index 83% rename from src/SDL_fatal.h rename to src/thread/generic/SDL_systls.c index 3a81689b9..bdb83dbf9 100644 --- a/src/SDL_fatal.h +++ b/src/thread/generic/SDL_systls.c @@ -18,10 +18,21 @@ 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" -/* General fatal signal handling code for SDL */ -extern void SDL_InstallParachute(void); -extern void SDL_UninstallParachute(void); +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/psp/SDL_syssem.c b/src/thread/psp/SDL_syssem.c index 22ecc5f6b..8eff409e0 100644 --- a/src/thread/psp/SDL_syssem.c +++ b/src/thread/psp/SDL_syssem.c @@ -31,42 +31,42 @@ #include struct SDL_semaphore { - SceUID semid; + SceUID semid; }; /* Create a semaphore */ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { - SDL_sem *sem; + 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(); - } + 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; + return sem; } /* Free the semaphore */ void SDL_DestroySemaphore(SDL_sem *sem) { - if (sem != NULL) { - if (sem->semid > 0) { - sceKernelDeleteSema(sem->semid); - sem->semid = 0; - } + if (sem != NULL) { + if (sem->semid > 0) { + sceKernelDeleteSema(sem->semid); + sem->semid = 0; + } - free(sem); - } + free(sem); + } } /* TODO: This routine is a bit overloaded. @@ -75,30 +75,30 @@ void SDL_DestroySemaphore(SDL_sem *sem) * is specified, convert it to microseconds. */ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { - Uint32 *pTimeout; + Uint32 *pTimeout; unsigned int res; - if (sem == NULL) { - SDL_SetError("Passed a NULL sem"); - return 0; - } + 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 == 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; - } + if (timeout == SDL_MUTEX_MAXWAIT) { + pTimeout = NULL; + } else { + timeout *= 1000; /* Convert to microseconds. */ + pTimeout = &timeout; + } - res = sceKernelWaitSema(sem->semid, 1, pTimeout); + res = sceKernelWaitSema(sem->semid, 1, pTimeout); switch (res) { case SCE_KERNEL_ERROR_OK: return 0; @@ -106,50 +106,50 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) return SDL_MUTEX_TIMEDOUT; default: return SDL_SetError("WaitForSingleObject() failed"); - } + } } int SDL_SemTryWait(SDL_sem *sem) { - return SDL_SemWaitTimeout(sem, 0); + return SDL_SemWaitTimeout(sem, 0); } 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) { - SceKernelSemaInfo info; + SceKernelSemaInfo info; - if (sem == NULL) { - SDL_SetError("Passed a NULL sem"); - return 0; - } + if (sem == NULL) { + SDL_SetError("Passed a NULL sem"); + return 0; + } - if (sceKernelReferSemaStatus(sem->semid, &info) >= 0) { - return info.currentCount; - } + if (sceKernelReferSemaStatus(sem->semid, &info) >= 0) { + return info.currentCount; + } - return 0; + return 0; } int SDL_SemPost(SDL_sem *sem) { - int res; + int res; - if (sem == NULL) { - return SDL_SetError("Passed a NULL sem"); - } + if (sem == NULL) { + return SDL_SetError("Passed a NULL sem"); + } - res = sceKernelSignalSema(sem->semid, 1); - if (res < 0) { - return SDL_SetError("sceKernelSignalSema() failed"); - } + res = sceKernelSignalSema(sem->semid, 1); + if (res < 0) { + return SDL_SetError("sceKernelSignalSema() failed"); + } - return 0; + return 0; } /* vim: ts=4 sw=4 diff --git a/src/thread/psp/SDL_systhread.c b/src/thread/psp/SDL_systhread.c index 57b932084..05a2341fe 100644 --- a/src/thread/psp/SDL_systhread.c +++ b/src/thread/psp/SDL_systhread.c @@ -35,57 +35,57 @@ static int ThreadEntry(SceSize args, void *argp) { - SDL_RunThread(*(void **) argp); - return 0; + SDL_RunThread(*(void **) argp); + return 0; } int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) { - SceKernelThreadInfo status; - int priority = 32; + 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; - } + /* 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"); - } + 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; + sceKernelStartThread(thread->handle, 4, &args); + return 0; } void SDL_SYS_SetupThread(const char *name) { - /* Do nothing. */ + /* Do nothing. */ } SDL_threadID SDL_ThreadID(void) { - return (SDL_threadID) sceKernelGetThreadId(); + return (SDL_threadID) sceKernelGetThreadId(); } void SDL_SYS_WaitThread(SDL_Thread *thread) { - sceKernelWaitThreadEnd(thread->handle, NULL); - sceKernelDeleteThread(thread->handle); + sceKernelWaitThreadEnd(thread->handle, NULL); + sceKernelDeleteThread(thread->handle); } void SDL_SYS_KillThread(SDL_Thread *thread) -{ - sceKernelTerminateDeleteThread(thread->handle); +{ + 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) { @@ -93,7 +93,7 @@ int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) } else { value = 0; } - + return sceKernelChangeThreadPriority(sceKernelGetThreadId(),value); } diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index 62436936e..c967ca7f3 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -34,7 +34,7 @@ #include #include #include -#endif // __LINUX__ +#endif /* __LINUX__ */ #if defined(__LINUX__) || defined(__MACOSX__) || defined(__IPHONEOS__) #include diff --git a/src/thread/pthread/SDL_systls.c b/src/thread/pthread/SDL_systls.c new file mode 100644 index 000000000..9ef6e51ac --- /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/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c index 6ae9cdb8f..6cf826ec7 100644 --- a/src/thread/windows/SDL_systhread.c +++ b/src/thread/windows/SDL_systhread.c @@ -36,7 +36,7 @@ /* 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 (__stdcall *func)(void *), void *arg, unsigned, unsigned *threadID); typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); @@ -106,6 +106,12 @@ 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) @@ -118,9 +124,9 @@ SDL_SYS_CreateThread(SDL_Thread * thread, void *args) if (!pThreadParms) { return SDL_OutOfMemory(); } - // Save the function which we will have to call to clear the RTL of calling app! + /* 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 + /* Also save the real parameters we have to pass to thread function */ pThreadParms->args = args; if (pfnBeginThread) { diff --git a/src/thread/windows/SDL_systls.c b/src/thread/windows/SDL_systls.c new file mode 100644 index 000000000..0ece77dd0 --- /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_timer.c b/src/timer/SDL_timer.c index 60b3bdb12..5b6550c1c 100644 --- a/src/timer/SDL_timer.c +++ b/src/timer/SDL_timer.c @@ -26,6 +26,8 @@ #include "SDL_cpuinfo.h" #include "SDL_thread.h" +extern void SDL_StartTicks(void); + /* #define DEBUG_TIMERS */ typedef struct _SDL_Timer @@ -70,6 +72,16 @@ typedef struct { static SDL_TimerData SDL_timer_data; +static Uint32 ticks_started = 0; + +void +SDL_InitTicks(void) +{ + if (!ticks_started) { + SDL_StartTicks(); + ticks_started = 1; + } +} /* The idea here is that any thread might add a timer, but a single * thread manages the active timer queue, sorted by scheduling time. @@ -324,7 +336,7 @@ SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *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); diff --git a/src/timer/SDL_timer_c.h b/src/timer/SDL_timer_c.h index 559b36404..157485310 100644 --- a/src/timer/SDL_timer_c.h +++ b/src/timer/SDL_timer_c.h @@ -23,9 +23,10 @@ /* Useful functions and variables from SDL_timer.c */ #include "SDL_timer.h" -#define ROUND_RESOLUTION(X) \ - (((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION) +#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); diff --git a/src/timer/psp/SDL_systimer.c b/src/timer/psp/SDL_systimer.c index cfb0aeb25..59bb4df1c 100644 --- a/src/timer/psp/SDL_systimer.c +++ b/src/timer/psp/SDL_systimer.c @@ -32,17 +32,17 @@ static struct timeval start; void SDL_StartTicks(void) { - gettimeofday(&start, NULL); + gettimeofday(&start, NULL); } Uint32 SDL_GetTicks(void) { - struct timeval now; - Uint32 ticks; + 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); + gettimeofday(&now, NULL); + ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000; + return(ticks); } Uint64 @@ -59,10 +59,10 @@ SDL_GetPerformanceFrequency(void) void SDL_Delay(Uint32 ms) { - const Uint32 max_delay = 0xffffffffUL / 1000; - if(ms > max_delay) - ms = max_delay; - sceKernelDelayThreadCB(ms * 1000); + 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/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index 57ce078cc..596d749ab 100644 --- a/src/timer/unix/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -34,85 +34,115 @@ 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 +#ifdef __APPLE__ +#include +#endif /* The first ticks value of the application */ -#ifdef HAVE_CLOCK_GETTIME -static struct timespec start; -#else -static struct timeval start; -#endif /* HAVE_CLOCK_GETTIME */ - +#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; void SDL_StartTicks(void) { /* Set first ticks value */ #if HAVE_CLOCK_GETTIME - clock_gettime(CLOCK_MONOTONIC, &start); -#else - gettimeofday(&start, NULL); + 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 - 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); + 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); } Uint64 SDL_GetPerformanceCounter(void) { + Uint64 ticks; + if (has_monotonic_time) { #if HAVE_CLOCK_GETTIME - Uint64 ticks; - struct timespec now; + struct timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); - ticks = now.tv_sec; - ticks *= 1000000000; - ticks += now.tv_nsec; - return (ticks); -#else - Uint64 ticks; - struct timeval now; - - gettimeofday(&now, NULL); - ticks = now.tv_sec; - ticks *= 1000000; - ticks += now.tv_usec; - return (ticks); + 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); } Uint64 SDL_GetPerformanceFrequency(void) { + if (has_monotonic_time) { #if HAVE_CLOCK_GETTIME - return 1000000000; -#else - return 1000000; + 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 diff --git a/src/timer/windows/SDL_systimer.c b/src/timer/windows/SDL_systimer.c index 9cb5cd9fd..ce6bd7a70 100644 --- a/src/timer/windows/SDL_systimer.c +++ b/src/timer/windows/SDL_systimer.c @@ -26,8 +26,8 @@ #include #include "SDL_timer.h" +#include "SDL_hints.h" -#define TIME_WRAP_VALUE (~(DWORD)0) /* The first (low-resolution) ticks value of the application */ static DWORD start; @@ -41,6 +41,40 @@ static LARGE_INTEGER hires_start_ticks; 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) { @@ -48,28 +82,27 @@ SDL_StartTicks(void) #ifdef USE_GETTICKCOUNT start = GetTickCount(); #else -#ifdef __WINRT__ /* Apparently there are problems with QPC on Win2K */ + /* 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 -#endif - { + } else { hires_timer_available = FALSE; -#ifdef __WINRT__ - start = 0; /* the timer failed to start! */ -#else - timeBeginPeriod(1); /* use 1 ms timer precision */ + timeSetPeriod(1); /* use 1 ms timer precision */ start = timeGetTime(); -#endif } #endif + + SDL_AddHintCallback(SDL_HINT_TIMER_RESOLUTION, + SDL_TimerResolutionChanged, NULL); } Uint32 SDL_GetTicks(void) { - DWORD now, ticks; + DWORD now; #ifndef USE_GETTICKCOUNT LARGE_INTEGER hires_now; #endif @@ -86,20 +119,11 @@ SDL_GetTicks(void) return (DWORD) hires_now.QuadPart; } else { -#ifdef __WINRT__ - now = 0; -#else now = timeGetTime(); -#endif } #endif - if (now < start) { - ticks = (TIME_WRAP_VALUE - start) + now; - } else { - ticks = (now - start); - } - return (ticks); + return (now - start); } Uint64 @@ -124,19 +148,6 @@ SDL_GetPerformanceFrequency(void) return frequency.QuadPart; } -#ifdef __WINRT__ -static void -Sleep(DWORD timeout) -{ - static HANDLE mutex = 0; - if ( ! mutex ) - { - mutex = CreateEventEx(0, 0, 0, EVENT_ALL_ACCESS); - } - WaitForSingleObjectEx(mutex, timeout, FALSE); -} -#endif - void SDL_Delay(Uint32 ms) { diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index de61ccd47..25ecd4556 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -71,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. @@ -97,20 +97,14 @@ #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) /* @@ -120,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) /* @@ -144,98 +138,98 @@ 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; \ - } \ +#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) /* @@ -246,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) /* @@ -265,116 +259,116 @@ 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) -#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) /* @@ -387,48 +381,48 @@ RLEClipBlit(int w, Uint8 * srcbuf, SDL_Surface * dst, { 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); @@ -464,28 +458,28 @@ SDL_RLEBlit(SDL_Surface * src, SDL_Rect * srcrect, srcbuf = (Uint8 *) src->map->data; { - /* skip lines at the top if neccessary */ + /* 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; \ - } \ - } +#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: @@ -514,29 +508,29 @@ SDL_RLEBlit(SDL_Surface * src, SDL_Rect * srcrect, } 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) +#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); @@ -562,46 +556,46 @@ 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 | 0xff000000; \ +#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 @@ -635,72 +629,72 @@ 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) { @@ -804,50 +798,50 @@ SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect, * 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) +#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: @@ -1012,7 +1006,7 @@ uncopy_32(Uint32 * dst, void *src, int n, #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 */ @@ -1117,20 +1111,20 @@ RLEAlphaSurface(SDL_Surface * surface) 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; \ - } +#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) +#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; @@ -1312,16 +1306,16 @@ RLEColorkeySurface(SDL_Surface * surface) 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; \ - } +#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; @@ -1451,7 +1445,7 @@ SDL_RLESurface(SDL_Surface * surface) /* * 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 @@ -1545,7 +1539,7 @@ SDL_UnRLESurface(SDL_Surface * surface, int recode) return; } - /* fill it with the background colour */ + /* fill it with the background color */ SDL_FillRect(surface, NULL, surface->map->info.colorkey); /* now render the encoded surface */ diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index d7c258d4c..7b4f9edc9 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -61,7 +61,7 @@ SDL_SoftBlit(SDL_Surface * src, SDL_Rect * srcrect, } /* Set up source and destination buffer pointers, and BLIT! */ - if (okay && srcrect->w && srcrect->h) { + if (okay && !SDL_RectEmpty(srcrect)) { SDL_BlitFunc RunBlit; SDL_BlitInfo *info = &src->map->info; @@ -239,9 +239,11 @@ SDL_CalculateBlit(SDL_Surface * surface) /* Choose a standard blit function */ if (map->identity && !(map->info.flags & ~SDL_COPY_RLE_DESIRED)) { blit = SDL_BlitCopy; - } else if (surface->format->BitsPerPixel < 8) { + } else if (surface->format->BitsPerPixel < 8 && + SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { blit = SDL_CalculateBlit0(surface); - } else if (surface->format->BytesPerPixel == 1) { + } 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); @@ -260,8 +262,13 @@ SDL_CalculateBlit(SDL_Surface * surface) if (blit == NULL) #endif { - if (surface->format->BytesPerPixel > 1 - && dst->format->BytesPerPixel > 1) { + 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; } } diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index e9965561a..07d3af703 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -118,289 +118,344 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface * surface); #endif /* Load pixel of the specified format from a buffer and get its R-G-B values */ -#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_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 = 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_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 = 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_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; /* stop gcc complaints */ \ - break; \ - } \ +#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 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; \ - } \ +#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 */ -#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ -{ \ - Pixel = ((r>>fmt->Rloss)<Rshift)| \ - ((g>>fmt->Gloss)<Gshift)| \ - ((b>>fmt->Bloss)<Bshift)| \ - fmt->Amask; \ +#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ +{ \ + Pixel = ((r>>fmt->Rloss)<Rshift)| \ + ((g>>fmt->Gloss)<Gshift)| \ + ((b>>fmt->Bloss)<Bshift)| \ + fmt->Amask; \ } -#define RGB565_FROM_RGB(Pixel, r, g, b) \ -{ \ - Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \ +#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 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; \ +#define RGB888_FROM_RGB(Pixel, r, g, b) \ +{ \ + Pixel = (r<<16)|(g<<8)|b; \ } -#define ARGB8888_FROM_RGBA(Pixel, r, g, b, a) \ -{ \ - Pixel = (a<<24)|(r<<16)|(g<<8)|b; \ +#define ARGB8888_FROM_RGBA(Pixel, r, g, b, a) \ +{ \ + Pixel = (a<<24)|(r<<16)|(g<<8)|b; \ } -#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a) \ -{ \ - Pixel = (r<<24)|(g<<16)|(b<<8)|a; \ +#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a) \ +{ \ + Pixel = (r<<24)|(g<<16)|(b<<8)|a; \ } -#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a) \ -{ \ - Pixel = (a<<24)|(b<<16)|(g<<8)|r; \ +#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a) \ +{ \ + Pixel = (a<<24)|(b<<16)|(g<<8)|r; \ } -#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a) \ -{ \ - Pixel = (b<<24)|(g<<16)|(r<<8)|a; \ +#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a) \ +{ \ + Pixel = (b<<24)|(g<<16)|(r<<8)|a; \ } -#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 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 = 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_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 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_BGRA8888(Pixel, r, g, b, a) \ +{ \ + r = ((Pixel>>8)&0xFF); \ + g = ((Pixel>>16)&0xFF); \ + b = (Pixel>>24); \ + a = (Pixel&0xFF); \ } -#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \ -do { \ - switch (bpp) { \ - 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; \ - } \ +#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) */ -#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); \ +#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); \ } -#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: { \ - 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 = ((((int)(sR-dR)*(int)A)/255)+dR); \ - dG = ((((int)(sG-dG)*(int)A)/255)+dG); \ - dB = ((((int)(sB-dB)*(int)A)/255)+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) @@ -413,75 +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); \ - } \ +#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) +#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) { \ - n = (n+7)/ 8; \ - switch (n & 4) { \ - case 0: do { pixel_copy_increment4; \ - case 4: pixel_copy_increment4; \ - } while (--n > 0); \ - } \ - } \ +#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); \ + } \ } #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_LOOP_124(pixel_copy_increment1, \ - pixel_copy_increment2, \ - pixel_copy_increment4, width) \ - DUFFS_LOOP(pixel_copy_increment1, 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 */ diff --git a/src/video/SDL_blit_0.c b/src/video/SDL_blit_0.c index 12cf8607b..ba709745e 100644 --- a/src/video/SDL_blit_0.c +++ b/src/video/SDL_blit_0.c @@ -363,7 +363,10 @@ BlitBtoNAlpha(SDL_BlitInfo * info) SDL_PixelFormat *dstfmt = info->dst_fmt; int dstbpp; int c; - const int A = info->a; + Uint32 pixel; + unsigned sR, sG, sB; + unsigned dR, dG, dB, dA; + const unsigned A = info->a; /* Set up some basic variables */ dstbpp = dstfmt->BytesPerPixel; @@ -377,15 +380,12 @@ BlitBtoNAlpha(SDL_BlitInfo * info) } bit = (byte & 0x80) >> 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); + 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; @@ -409,7 +409,10 @@ BlitBtoNAlphaKey(SDL_BlitInfo * info) const SDL_Color *srcpal = srcfmt->palette->colors; int dstbpp; int c; - const int A = info->a; + 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 */ @@ -424,15 +427,12 @@ BlitBtoNAlphaKey(SDL_BlitInfo * info) } bit = (byte & 0x80) >> 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); + 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; diff --git a/src/video/SDL_blit_1.c b/src/video/SDL_blit_1.c index 514edab01..67503e879 100644 --- a/src/video/SDL_blit_1.c +++ b/src/video/SDL_blit_1.c @@ -437,30 +437,29 @@ Blit1toNAlpha(SDL_BlitInfo * info) SDL_PixelFormat *dstfmt = info->dst_fmt; const SDL_Color *srcpal = info->src_fmt->palette->colors; int dstbpp; - const int A = info->a; + 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--) { - int sR, sG, sB; - int dR, dG, dB; - /* *INDENT-OFF* */ - 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); - /* *INDENT-ON* */ + /* *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; } @@ -479,26 +478,25 @@ Blit1toNAlphaKey(SDL_BlitInfo * info) const SDL_Color *srcpal = info->src_fmt->palette->colors; Uint32 ckey = info->colorkey; int dstbpp; - const int A = info->a; + 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--) { - int sR, sG, sB; - int dR, dG, dB; /* *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; diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 002a1af92..3fb89c061 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -39,37 +39,28 @@ BlitNto1SurfaceAlpha(SDL_BlitInfo * info) 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; @@ -95,36 +86,27 @@ BlitNto1PixelAlpha(SDL_BlitInfo * info) 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; @@ -151,38 +133,29 @@ BlitNto1SurfaceAlphaKey(SDL_BlitInfo * info) SDL_PixelFormat *dstfmt = info->dst_fmt; int srcbpp = srcfmt->BytesPerPixel; Uint32 ckey = info->colorkey; - - const int A = info->a; + 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++; @@ -417,807 +390,6 @@ BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info) #endif /* __MMX__ */ -#if SDL_ALTIVEC_BLITTERS -#if __MWERKS__ -#pragma altivec_model on -#endif -#if HAVE_ALTIVEC_H -#include -#endif - -#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 = { - 0, NULL, 0, 0, - {0, 0}, - 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, - 0, 0, 0, 0, - 16, 8, 0, 24, - 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); - 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->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 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->dst_w; - -#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) -{ - 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 *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; - unsigned sA = info->a; - unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; - Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask; - Uint32 ckey = info->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] = sA; - 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->dst_w; -#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 - - srcp += srcskip; - dstp += dstskip; - } -} - - -static void -Blit32to32PixelAlphaAltivec(SDL_BlitInfo * info) -{ - 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 *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; - 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->dst_w; -#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->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; - 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->dst_w; -#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 */ - 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 *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; - unsigned sA = info->a; - 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] = sA; - valpha = vec_splat(valpha, 0); - vbits = (vector unsigned char) vec_splat_s8(-1); - - while (height--) { - int width = info->dst_w; -#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->a; - 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; - 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->dst_w; -#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 */ - /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo * info) @@ -1984,24 +1156,19 @@ BlitNtoNSurfaceAlpha(SDL_BlitInfo * info) SDL_PixelFormat *dstfmt = info->dst_fmt; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; - unsigned sA = info->a; - unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; + 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; @@ -2029,25 +1196,20 @@ BlitNtoNSurfaceAlphaKey(SDL_BlitInfo * info) Uint32 ckey = info->colorkey; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; - unsigned sA = info->a; - unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; + 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; @@ -2072,9 +1234,11 @@ BlitNtoNPixelAlpha(SDL_BlitInfo * info) 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; @@ -2084,20 +1248,11 @@ BlitNtoNPixelAlpha(SDL_BlitInfo * info) /* *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; @@ -2124,13 +1279,6 @@ SDL_CalculateBlitA(SDL_Surface * surface) return BlitNto1PixelAlpha; case 2: -#if SDL_ALTIVEC_BLITTERS - if (sf->BytesPerPixel == 4 - && 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) @@ -2162,19 +1310,10 @@ SDL_CalculateBlitA(SDL_Surface * surface) } #endif /* __MMX__ || __3dNOW__ */ if (sf->Amask == 0xff000000) { -#if SDL_ALTIVEC_BLITTERS - if (SDL_HasAltiVec()) - return BlitRGBtoRGBPixelAlphaAltivec; -#endif return BlitRGBtoRGBPixelAlpha; } } -#if SDL_ALTIVEC_BLITTERS - if (sf->Amask && sf->BytesPerPixel == 4 && SDL_HasAltiVec()) - return Blit32to32PixelAlphaAltivec; - else -#endif - return BlitNtoNPixelAlpha; + return BlitNtoNPixelAlpha; case 3: default: @@ -2220,19 +1359,10 @@ SDL_CalculateBlitA(SDL_Surface * surface) return BlitRGBtoRGBSurfaceAlphaMMX; #endif if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) { -#if SDL_ALTIVEC_BLITTERS - if (SDL_HasAltiVec()) - return BlitRGBtoRGBSurfaceAlphaAltivec; -#endif return BlitRGBtoRGBSurfaceAlpha; } } -#if SDL_ALTIVEC_BLITTERS - if ((sf->BytesPerPixel == 4) && SDL_HasAltiVec()) - return Blit32to32SurfaceAlphaAltivec; - else -#endif - return BlitNtoNSurfaceAlpha; + return BlitNtoNSurfaceAlpha; case 3: default: @@ -2243,16 +1373,11 @@ SDL_CalculateBlitA(SDL_Surface * surface) case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: if (sf->Amask == 0) { - if (df->BytesPerPixel == 1) + if (df->BytesPerPixel == 1) { return BlitNto1SurfaceAlphaKey; - else -#if SDL_ALTIVEC_BLITTERS - if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 && - SDL_HasAltiVec()) - return Blit32to32SurfaceAlphaKeyAltivec; - else -#endif + } else { return BlitNtoNSurfaceAlphaKey; + } } break; } diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index 4ca365680..84c96e2dc 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -275,7 +275,7 @@ 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 @@ -422,7 +422,7 @@ 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 @@ -876,18 +876,18 @@ 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 /* 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)); \ + dst = (Uint8)((((src)&0x00E00000)>>16)| \ + (((src)&0x0000E000)>>11)| \ + (((src)&0x000000C0)>>6)); \ } static void Blit_RGB888_index8(SDL_BlitInfo * info) @@ -913,11 +913,11 @@ Blit_RGB888_index8(SDL_BlitInfo * info) if (map == NULL) { while (height--) { #ifdef USE_DUFFS_LOOP - /* *INDENT-OFF* */ - DUFFS_LOOP( - RGB888_RGB332(*dst++, *src); - , width); - /* *INDENT-ON* */ + /* *INDENT-OFF* */ + DUFFS_LOOP( + RGB888_RGB332(*dst++, *src); + , width); + /* *INDENT-ON* */ #else for (c = width / 4; c; --c) { /* Pack RGB into 8bit pixel */ @@ -949,13 +949,13 @@ Blit_RGB888_index8(SDL_BlitInfo * info) while (height--) { #ifdef USE_DUFFS_LOOP - /* *INDENT-OFF* */ - DUFFS_LOOP( - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - , width); - /* *INDENT-ON* */ + /* *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 */ @@ -993,19 +993,129 @@ Blit_RGB888_index8(SDL_BlitInfo * info) } } +/* 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_RGB101010_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( + RGB101010_RGB332(*dst++, *src); + , width); + /* *INDENT-ON* */ +#else + 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; + + while (height--) { +#ifdef USE_DUFFS_LOOP + /* *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 */ + 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; + } + } +} + /* 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) @@ -1028,13 +1138,13 @@ Blit_RGB888_RGB555(SDL_BlitInfo * info) #ifdef USE_DUFFS_LOOP while (height--) { - /* *INDENT-OFF* */ - DUFFS_LOOP( - RGB888_RGB555(dst, src); - ++src; - ++dst; - , width); - /* *INDENT-ON* */ + /* *INDENT-OFF* */ + DUFFS_LOOP( + RGB888_RGB555(dst, src); + ++src; + ++dst; + , width); + /* *INDENT-ON* */ src += srcskip; dst += dstskip; } @@ -1119,17 +1229,17 @@ Blit_RGB888_RGB555(SDL_BlitInfo * info) /* 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) @@ -1152,13 +1262,13 @@ Blit_RGB888_RGB565(SDL_BlitInfo * info) #ifdef USE_DUFFS_LOOP while (height--) { - /* *INDENT-OFF* */ - DUFFS_LOOP( - RGB888_RGB565(dst, src); - ++src; - ++dst; - , width); - /* *INDENT-ON* */ + /* *INDENT-OFF* */ + DUFFS_LOOP( + RGB888_RGB565(dst, src); + ++src; + ++dst; + , width); + /* *INDENT-ON* */ src += srcskip; dst += dstskip; } @@ -1265,14 +1375,14 @@ Blit_RGB565_32(SDL_BlitInfo * info, const Uint32 * map) #ifdef USE_DUFFS_LOOP while (height--) { - /* *INDENT-OFF* */ - DUFFS_LOOP( - { - *dst++ = RGB565_32(dst, src, map); - src += 2; - }, - width); - /* *INDENT-ON* */ + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + *dst++ = RGB565_32(dst, src, map); + src += 2; + }, + width); + /* *INDENT-ON* */ src += srcskip; dst += dstskip; } @@ -1860,85 +1970,6 @@ 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) -{ -#ifndef USE_DUFFS_LOOP - 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->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; - -#ifdef USE_DUFFS_LOOP - while (height--) { - /* *INDENT-OFF* */ - DUFFS_LOOP( - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - , width); - /* *INDENT-ON* */ - src += srcskip; - dst += dstskip; - } -#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) { @@ -1969,20 +2000,20 @@ BlitNto1(SDL_BlitInfo * info) if (map == NULL) { while (height--) { #ifdef USE_DUFFS_LOOP - /* *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* */ + /* *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 for (c = width; c; --c) { DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); @@ -2001,20 +2032,20 @@ BlitNto1(SDL_BlitInfo * info) } else { while (height--) { #ifdef USE_DUFFS_LOOP - /* *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* */ + /* *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); @@ -2051,15 +2082,15 @@ Blit4to4MaskAlpha(SDL_BlitInfo * info) Uint32 mask = (info->a >> dstfmt->Aloss) << dstfmt->Ashift; while (height--) { - /* *INDENT-OFF* */ - DUFFS_LOOP( - { - *dst = *src | mask; - ++dst; - ++src; - }, - width); - /* *INDENT-ON* */ + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + *dst = *src | mask; + ++dst; + ++src; + }, + width); + /* *INDENT-ON* */ src = (Uint32 *) ((Uint8 *) src + srcskip); dst = (Uint32 *) ((Uint8 *) dst + dstskip); } @@ -2068,15 +2099,15 @@ Blit4to4MaskAlpha(SDL_BlitInfo * info) Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask; while (height--) { - /* *INDENT-OFF* */ - DUFFS_LOOP( - { - *dst = *src & mask; - ++dst; - ++src; - }, - width); - /* *INDENT-ON* */ + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + *dst = *src & mask; + ++dst; + ++src; + }, + width); + /* *INDENT-ON* */ src = (Uint32 *) ((Uint8 *) src + srcskip); dst = (Uint32 *) ((Uint8 *) dst + dstskip); } @@ -2099,20 +2130,20 @@ BlitNtoN(SDL_BlitInfo * info) unsigned alpha = dstfmt->Amask ? info->a : 0; while (height--) { - /* *INDENT-OFF* */ - DUFFS_LOOP( - { + /* *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* */ + 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; } @@ -2170,43 +2201,43 @@ BlitNto1Key(SDL_BlitInfo * info) 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* */ + /* *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* */ + /* *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; } @@ -2231,17 +2262,17 @@ Blit2to2Key(SDL_BlitInfo * info) ckey &= rgbmask; while (height--) { - /* *INDENT-OFF* */ - DUFFS_LOOP( - { - if ( (*srcp & rgbmask) != ckey ) { - *dstp = *srcp; - } - dstp++; - srcp++; - }, - width); - /* *INDENT-ON* */ + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + if ( (*srcp & rgbmask) != ckey ) { + *dstp = *srcp; + } + dstp++; + srcp++; + }, + width); + /* *INDENT-ON* */ srcp += srcskip; dstp += dstskip; } @@ -2268,23 +2299,23 @@ BlitNtoNKey(SDL_BlitInfo * info) ckey &= rgbmask; while (height--) { - /* *INDENT-OFF* */ - DUFFS_LOOP( - { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { Uint32 Pixel; - unsigned sR; - unsigned sG; - unsigned sB; - RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel); - if ( (Pixel & rgbmask) != ckey ) { + 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* */ + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha); + } + dst += dstbpp; + src += srcbpp; + }, + width); + /* *INDENT-ON* */ src += srcskip; dst += dstskip; } @@ -2315,18 +2346,82 @@ BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info) 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* */ + /* *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; + } +} + +/* Special optimized blit for ARGB 2-10-10-10 --> RGBA */ +static void +Blit2101010toN(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 *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; + } +} + +/* Special optimized blit for RGBA --> ARGB 2-10-10-10 */ +static void +BlitNto2101010(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; + 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; } @@ -2344,31 +2439,25 @@ struct blit_table { 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}, + /* 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_ALTIVEC_BLITTERS /* has-altivec */ - {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, - 0x00000000, + {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000, 2, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, - {0x00007C00, 0x000003E0, 0x0000001F, 4, 0x00000000, 0x00000000, - 0x00000000, + {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, + {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, 0, Blit_RGB565_ARGB8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, - {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x000000FF, 0x0000FF00, - 0x00FF0000, + {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, 0, Blit_RGB565_ABGR8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, - {0x0000F800, 0x000007E0, 0x0000001F, 4, 0xFF000000, 0x00FF0000, - 0x0000FF00, + {0x0000F800, 0x000007E0, 0x0000001F, 4, 0xFF000000, 0x00FF0000, 0x0000FF00, 0, Blit_RGB565_RGBA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, - {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x0000FF00, 0x00FF0000, - 0xFF000000, + {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 */ @@ -2383,25 +2472,18 @@ static const struct blit_table normal_blit_3[] = { static const struct blit_table normal_blit_4[] = { #if SDL_ALTIVEC_BLITTERS /* has-altivec | dont-use-prefetch */ - {0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, - 0x00000000, - 6, 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, 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, + {0x00000000, 0x00000000, 0x00000000, 2, 0x0000F800, 0x000007E0, 0x0000001F, 2, Blit_RGB888_RGB565Altivec, NO_ALPHA}, #endif - {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0, - 0x0000001F, + {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0, 0x0000001F, 0, Blit_RGB888_RGB565, NO_ALPHA}, - {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0, - 0x0000001F, + {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} @@ -2436,16 +2518,16 @@ SDL_CalculateBlitN(SDL_Surface * surface) case 0: 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->info.table) { - blitfun = Blit_RGB888_index8_map; - } else { - blitfun = Blit_RGB888_index8; - } + 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; } @@ -2471,11 +2553,16 @@ SDL_CalculateBlitN(SDL_Surface * surface) 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) { + 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; diff --git a/src/video/SDL_blit_auto.c b/src/video/SDL_blit_auto.c index f6a5284f9..251c5fe80 100644 --- a/src/video/SDL_blit_auto.c +++ b/src/video/SDL_blit_auto.c @@ -95,6 +95,7 @@ static void SDL_Blit_RGB888_RGB888_Blend(SDL_BlitInfo *info) 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; @@ -168,6 +169,7 @@ static void SDL_Blit_RGB888_RGB888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -323,6 +325,7 @@ static void SDL_Blit_RGB888_RGB888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -408,6 +411,7 @@ static void SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -503,6 +507,7 @@ static void SDL_Blit_RGB888_BGR888_Blend(SDL_BlitInfo *info) 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; @@ -576,6 +581,7 @@ static void SDL_Blit_RGB888_BGR888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -731,6 +737,7 @@ static void SDL_Blit_RGB888_BGR888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -816,6 +823,7 @@ static void SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -911,6 +919,7 @@ static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info) 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; @@ -984,6 +993,7 @@ static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -1139,6 +1149,7 @@ static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -1224,6 +1235,7 @@ static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -1319,6 +1331,7 @@ static void SDL_Blit_BGR888_RGB888_Blend(SDL_BlitInfo *info) 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; @@ -1392,6 +1405,7 @@ static void SDL_Blit_BGR888_RGB888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -1547,6 +1561,7 @@ static void SDL_Blit_BGR888_RGB888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -1632,6 +1647,7 @@ static void SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -1722,6 +1738,7 @@ static void SDL_Blit_BGR888_BGR888_Blend(SDL_BlitInfo *info) 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; @@ -1795,6 +1812,7 @@ static void SDL_Blit_BGR888_BGR888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -1950,6 +1968,7 @@ static void SDL_Blit_BGR888_BGR888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -2035,6 +2054,7 @@ static void SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -2130,6 +2150,7 @@ static void SDL_Blit_BGR888_ARGB8888_Blend(SDL_BlitInfo *info) 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; @@ -2203,6 +2224,7 @@ static void SDL_Blit_BGR888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -2358,6 +2380,7 @@ static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -2443,6 +2466,7 @@ static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -2538,6 +2562,7 @@ static void SDL_Blit_ARGB8888_RGB888_Blend(SDL_BlitInfo *info) 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; @@ -2611,6 +2636,7 @@ static void SDL_Blit_ARGB8888_RGB888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -2766,6 +2792,7 @@ static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -2851,6 +2878,7 @@ static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -2946,6 +2974,7 @@ static void SDL_Blit_ARGB8888_BGR888_Blend(SDL_BlitInfo *info) 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; @@ -3019,6 +3048,7 @@ static void SDL_Blit_ARGB8888_BGR888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -3174,6 +3204,7 @@ static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -3259,6 +3290,7 @@ static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -3349,6 +3381,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) 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; @@ -3422,6 +3455,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -3577,6 +3611,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -3662,6 +3697,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -3757,6 +3793,7 @@ static void SDL_Blit_RGBA8888_RGB888_Blend(SDL_BlitInfo *info) 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; @@ -3830,6 +3867,7 @@ static void SDL_Blit_RGBA8888_RGB888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -3985,6 +4023,7 @@ static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -4070,6 +4109,7 @@ static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -4165,6 +4205,7 @@ static void SDL_Blit_RGBA8888_BGR888_Blend(SDL_BlitInfo *info) 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; @@ -4238,6 +4279,7 @@ static void SDL_Blit_RGBA8888_BGR888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -4393,6 +4435,7 @@ static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -4478,6 +4521,7 @@ static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -4573,6 +4617,7 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) 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; @@ -4646,6 +4691,7 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -4801,6 +4847,7 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -4886,6 +4933,7 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -4981,6 +5029,7 @@ static void SDL_Blit_ABGR8888_RGB888_Blend(SDL_BlitInfo *info) 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; @@ -5054,6 +5103,7 @@ static void SDL_Blit_ABGR8888_RGB888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -5209,6 +5259,7 @@ static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -5294,6 +5345,7 @@ static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -5389,6 +5441,7 @@ static void SDL_Blit_ABGR8888_BGR888_Blend(SDL_BlitInfo *info) 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; @@ -5462,6 +5515,7 @@ static void SDL_Blit_ABGR8888_BGR888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -5617,6 +5671,7 @@ static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -5702,6 +5757,7 @@ static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -5797,6 +5853,7 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) 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; @@ -5870,6 +5927,7 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -6025,6 +6083,7 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -6110,6 +6169,7 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -6205,6 +6265,7 @@ static void SDL_Blit_BGRA8888_RGB888_Blend(SDL_BlitInfo *info) 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; @@ -6278,6 +6339,7 @@ static void SDL_Blit_BGRA8888_RGB888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -6433,6 +6495,7 @@ static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -6518,6 +6581,7 @@ static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -6613,6 +6677,7 @@ static void SDL_Blit_BGRA8888_BGR888_Blend(SDL_BlitInfo *info) 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; @@ -6686,6 +6751,7 @@ static void SDL_Blit_BGRA8888_BGR888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -6841,6 +6907,7 @@ static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -6926,6 +6993,7 @@ static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; @@ -7021,6 +7089,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) 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; @@ -7094,6 +7163,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) 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; @@ -7249,6 +7319,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) 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; @@ -7334,6 +7405,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) 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; diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index 5b861dd93..df43ed0ce 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -20,14 +20,14 @@ */ #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. */ @@ -40,13 +40,42 @@ /* 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 +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) { @@ -64,6 +93,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) Uint8 *top, *end; SDL_bool topDown; int ExpandBMP; + SDL_bool correctAlpha = SDL_FALSE; /* The Win32 BMP file header (14 bytes) */ char magic[2]; @@ -182,6 +212,8 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) #endif break; case 32: + /* We don't know if this has alpha channel or not */ + correctAlpha = SDL_TRUE; Amask = 0xFF000000; Rmask = 0x00FF0000; Gmask = 0x0000FF00; @@ -358,6 +390,9 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) bits -= surface->pitch; } } + if (correctAlpha) { + CorrectAlphaChannel(surface); + } done: if (was_error) { if (src) { @@ -439,7 +474,7 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) /* 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, + SDL_InitFormat(&format, #if SDL_BYTEORDER == SDL_LIL_ENDIAN SDL_PIXELFORMAT_ARGB8888 #else diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 84a75b8eb..c472c38b5 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -139,7 +139,7 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask, SDL_SetError("FOURCC pixel formats are not supported"); return SDL_FALSE; } - + /* Initialize the values here */ if (SDL_BYTESPERPIXEL(format) <= 2) { *bpp = SDL_BITSPERPIXEL(format); @@ -503,6 +503,7 @@ SDL_AllocFormat(Uint32 pixel_format) } if (SDL_InitFormat(format, pixel_format) < 0) { SDL_free(format); + SDL_InvalidParamError("format"); return NULL; } @@ -585,6 +586,7 @@ SDL_FreeFormat(SDL_PixelFormat *format) SDL_PixelFormat *prev; if (!format) { + SDL_InvalidParamError("format"); return; } if (--format->refcount > 0) { @@ -614,6 +616,12 @@ SDL_AllocPalette(int ncolors) { SDL_Palette *palette; + /* Input validation */ + if (ncolors < 1) { + SDL_InvalidParamError("ncolors"); + return NULL; + } + palette = (SDL_Palette *) SDL_malloc(sizeof(*palette)); if (!palette) { SDL_OutOfMemory(); @@ -693,6 +701,7 @@ void SDL_FreePalette(SDL_Palette * palette) { if (!palette) { + SDL_InvalidParamError("palette"); return; } if (--palette->refcount > 0) { @@ -732,7 +741,7 @@ SDL_DitherColors(SDL_Color * colors, int bpp) } } -/* +/* * Calculate the pad-aligned scanline width of a surface */ int @@ -1046,7 +1055,7 @@ SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst) 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 + 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; @@ -1082,8 +1091,18 @@ 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) { + if (gamma == 0.0f) { for (i = 0; i < 256; ++i) { ramp[i] = 0; } diff --git a/src/video/SDL_rect.c b/src/video/SDL_rect.c index 045d3f1cf..8dcb5b651 100644 --- a/src/video/SDL_rect.c +++ b/src/video/SDL_rect.c @@ -85,7 +85,7 @@ SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result) SDL_InvalidParamError("B"); return SDL_FALSE; } - + if (!result) { SDL_InvalidParamError("result"); return SDL_FALSE; @@ -97,7 +97,7 @@ SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result) result->h = 0; return SDL_FALSE; } - + /* Horizontal intersection */ Amin = A->x; Amax = Amin + A->w; @@ -139,7 +139,7 @@ SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result) SDL_InvalidParamError("B"); return; } - + if (!result) { SDL_InvalidParamError("result"); return; @@ -155,14 +155,14 @@ SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result) *result = *B; return; } - } else { + } else { if (SDL_RectEmpty(B)) { /* A not empty, B empty */ *result = *A; return; - } + } } - + /* Horizontal union */ Amin = A->x; Amax = Amin + A->w; @@ -219,7 +219,7 @@ SDL_EnclosePoints(const SDL_Point * points, int count, const SDL_Rect * clip, if (SDL_RectEmpty(clip)) { return SDL_FALSE; } - + for (i = 0; i < count; ++i) { x = points[i].x; y = points[i].y; @@ -259,7 +259,7 @@ SDL_EnclosePoints(const SDL_Point * points, int count, const SDL_Rect * clip, if (result == NULL) { return SDL_TRUE; } - + /* No clipping, always add the first point */ minx = maxx = points[0].x; miny = maxy = points[0].y; @@ -330,22 +330,22 @@ SDL_IntersectRectAndLine(const SDL_Rect * rect, int *X1, int *Y1, int *X2, 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; @@ -355,7 +355,7 @@ SDL_IntersectRectAndLine(const SDL_Rect * rect, int *X1, int *Y1, int *X2, if (SDL_RectEmpty(rect)) { return SDL_FALSE; } - + x1 = *X1; y1 = *Y1; x2 = *X2; diff --git a/src/video/SDL_shape.c b/src/video/SDL_shape.c index c3094802d..e9876e410 100644 --- a/src/video/SDL_shape.c +++ b/src/video/SDL_shape.c @@ -30,7 +30,8 @@ #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_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) { @@ -53,7 +54,8 @@ SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned } SDL_bool -SDL_IsShapedWindow(const SDL_Window *window) { +SDL_IsShapedWindow(const SDL_Window *window) +{ if(window == NULL) return SDL_FALSE; else @@ -62,7 +64,8 @@ SDL_IsShapedWindow(const SDL_Window *window) { /* 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) { +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; @@ -163,34 +166,35 @@ RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* mask,SDL_Rec last_opaque = pixel_opaque; if(last_opaque != pixel_opaque) { result->kind = QuadShape; - //These will stay the same. + /* These will stay the same. */ next.w = dimensions.w / 2; next.h = dimensions.h / 2; - //These will change from recursion to recursion. + /* 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; + /* 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; + /* 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". + /* 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_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape) +{ SDL_Rect dimensions = {0,0,shape->w,shape->h}; SDL_ShapeTree* result = NULL; if(SDL_MUSTLOCK(shape)) @@ -202,7 +206,8 @@ SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape) { } void -SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure) { +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); @@ -215,7 +220,8 @@ SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* c } void -SDL_FreeShapeTree(SDL_ShapeTree** shape_tree) { +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); @@ -227,15 +233,16 @@ SDL_FreeShapeTree(SDL_ShapeTree** shape_tree) { } int -SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) { +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. + /* The window given was not a shapeable window. */ return SDL_NONSHAPEABLE_WINDOW; if(shape == NULL) - //Invalid shape argument. + /* 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); @@ -249,21 +256,23 @@ SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *sh } static SDL_bool -SDL_WindowHasAShape(SDL_Window *window) { +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) { +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. + /* The window given has a shape. */ return 0; else - //The window given is shapeable but lacks a shape. + /* The window given is shapeable but lacks a shape. */ return SDL_WINDOW_LACKS_SHAPE; } else { @@ -272,6 +281,6 @@ SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode) { } } else - //The window given is not a valid shapeable window. + /* The window given is not a valid shapeable window. */ return SDL_NONSHAPEABLE_WINDOW; } diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index e976d10f0..69980d076 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -54,12 +54,12 @@ #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 @@ -148,23 +148,23 @@ generate_rowbytes(int src_w, int dst_w, int bpp) #endif /* USE_ASM_STRETCH */ -#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; \ - } \ +#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) @@ -220,7 +220,7 @@ SDL_SoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, #endif /* USE_ASM_STRETCH */ const int bpp = dst->format->BytesPerPixel; - if (src->format->BitsPerPixel != dst->format->BitsPerPixel) { + if (src->format->format != dst->format->format) { return SDL_SetError("Only works with same format surfaces"); } diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 94ce6eacc..460d53bc3 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -175,7 +175,11 @@ SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key) int flags; if (!surface) { - return -1; + return SDL_InvalidParamError("surface"); + } + + if (surface->format->palette && key >= ((Uint32) surface->format->palette->ncolors)) { + return SDL_InvalidParamError("key"); } if (flag & SDL_RLEACCEL) { @@ -251,11 +255,13 @@ SDL_ConvertColorkeyToAlpha(SDL_Surface * surface) 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 == ckey) { + if ((*spot & mask) == ckey) { *spot &= mask; } ++spot; @@ -273,11 +279,13 @@ SDL_ConvertColorkeyToAlpha(SDL_Surface * surface) 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 == ckey) { + if ((*spot & mask) == ckey) { *spot &= mask; } ++spot; @@ -473,13 +481,13 @@ SDL_GetClipRect(SDL_Surface * surface, SDL_Rect * 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. @@ -525,6 +533,8 @@ SDL_UpperBlit(SDL_Surface * src, const SDL_Rect * srcrect, /* 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; } @@ -615,6 +625,8 @@ SDL_UpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, /* 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; } @@ -738,7 +750,7 @@ SDL_LowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, src->map->info.flags |= SDL_COPY_NEAREST; if ( !(src->map->info.flags & complex_copy_flags) && - src->format->format == dst->format->format && + src->format->format == dst->format->format && !SDL_ISPIXELFORMAT_INDEXED(src->format->format) ) { return SDL_SoftStretch( src, &final_src, dst, &final_dst ); } else { @@ -785,7 +797,7 @@ SDL_UnlockSurface(SDL_Surface * surface) } } -/* +/* * Convert a surface into the specified pixel format. */ SDL_Surface * @@ -794,6 +806,7 @@ SDL_ConvertSurface(SDL_Surface * surface, SDL_PixelFormat * format, { SDL_Surface *convert; Uint32 copy_flags; + SDL_Color copy_color; SDL_Rect bounds; /* Check for empty destination palette! (results in empty image) */ @@ -830,7 +843,16 @@ SDL_ConvertSurface(SDL_Surface * surface, SDL_PixelFormat * format, /* 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; @@ -840,21 +862,26 @@ SDL_ConvertSurface(SDL_Surface * surface, SDL_PixelFormat * format, SDL_LowerBlit(surface, &bounds, convert, &bounds); /* Clean up the original surface, and update converted surface */ - convert->map->info.r = surface->map->info.r; - convert->map->info.g = surface->map->info.g; - convert->map->info.b = surface->map->info.b; - convert->map->info.a = surface->map->info.a; + 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 && + 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)) { @@ -917,7 +944,7 @@ SDL_ConvertSurfaceFormat(SDL_Surface * surface, Uint32 pixel_format, */ static __inline__ SDL_bool SDL_CreateSurfaceOnStack(int width, int height, Uint32 pixel_format, - void * pixels, int pitch, SDL_Surface * surface, + void * pixels, int pitch, SDL_Surface * surface, SDL_PixelFormat * format, SDL_BlitMap * blitmap) { if (SDL_ISPIXELFORMAT_INDEXED(pixel_format)) { diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index eae165d3b..e149b8a18 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -25,6 +25,7 @@ #include "SDL_messagebox.h" #include "SDL_shape.h" +#include "SDL_thread.h" /* The SDL video driver */ @@ -35,19 +36,19 @@ typedef struct SDL_VideoDevice SDL_VideoDevice; /* Define the SDL window-shaper structure */ struct SDL_WindowShaper -{ +{ /* The window associated with the shaper */ SDL_Window *window; - + /* The user's specified coordinates for the window, for once we give it a shape. */ Uint32 userx,usery; - + /* The parameters for shape calculation. */ SDL_WindowShapeMode mode; - + /* Has this window been assigned a shape? */ SDL_bool hasshape; - + void *driverdata; }; @@ -72,6 +73,7 @@ struct SDL_Window const void *magic; Uint32 id; char *title; + SDL_Surface *icon; int x, y; int w, h; int min_w, min_h; @@ -82,7 +84,7 @@ struct SDL_Window SDL_Rect windowed; SDL_DisplayMode fullscreen_mode; - + float brightness; Uint16 *gamma; Uint16 *saved_gamma; /* (just offset into gamma) */ @@ -128,7 +130,7 @@ struct SDL_VideoDisplay struct SDL_SysWMinfo; /* Define the SDL video driver structure */ -#define _THIS SDL_VideoDevice *_this +#define _THIS SDL_VideoDevice *_this struct SDL_VideoDevice { @@ -201,6 +203,7 @@ struct SDL_VideoDevice 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); /* * * */ /* @@ -241,10 +244,10 @@ struct SDL_VideoDevice void (*SetTextInputRect) (_THIS, SDL_Rect *rect); /* Screen keyboard */ - SDL_bool (*SDL_HasScreenKeyboardSupport) (_THIS); - void (*SDL_ShowScreenKeyboard) (_THIS, SDL_Window *window); - void (*SDL_HideScreenKeyboard) (_THIS, SDL_Window *window); - SDL_bool (*SDL_IsScreenKeyboardShown) (_THIS, SDL_Window *window); + 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); @@ -298,8 +301,13 @@ struct SDL_VideoDevice /* * * */ /* 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 */ @@ -370,12 +378,14 @@ 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(); +extern SDL_bool SDL_ShouldAllowTopmost(void); #endif /* _SDL_sysvideo_h */ diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 15d49794f..1404ba0e8 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -29,6 +29,7 @@ #include "SDL_pixels_c.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" @@ -362,23 +363,20 @@ SDL_DestroyWindowTexture(_THIS, SDL_Window * window) static int cmpmodes(const void *A, const void *B) { - SDL_DisplayMode a = *(const SDL_DisplayMode *) A; - SDL_DisplayMode b = *(const SDL_DisplayMode *) B; - - if (a.w != b.w) { - return b.w - a.w; - } - if (a.h != b.h) { - return b.h - a.h; - } - if (SDL_BITSPERPIXEL(a.format) != SDL_BITSPERPIXEL(b.format)) { - return SDL_BITSPERPIXEL(b.format) - SDL_BITSPERPIXEL(a.format); - } - if (SDL_PIXELLAYOUT(a.format) != SDL_PIXELLAYOUT(b.format)) { - return SDL_PIXELLAYOUT(b.format) - SDL_PIXELLAYOUT(a.format); - } - if (a.refresh_rate != b.refresh_rate) { - return b.refresh_rate - a.refresh_rate; + 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; } @@ -419,12 +417,15 @@ SDL_VideoInit(const char *driver_name) SDL_VideoQuit(); } +#if !SDL_TIMERS_DISABLED + SDL_InitTicks(); +#endif + /* Start the event loop */ - if (SDL_StartEventLoop() < 0 || + if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0 || SDL_KeyboardInit() < 0 || SDL_MouseInit() < 0 || - SDL_TouchInit() < 0 || - SDL_QuitInit() < 0) { + SDL_TouchInit() < 0) { return -1; } @@ -499,6 +500,9 @@ SDL_VideoInit(const char *driver_name) _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(); @@ -662,8 +666,8 @@ SDL_AddDisplayMode(SDL_VideoDisplay * display, const SDL_DisplayMode * mode) /* Make sure we don't already have the mode in the list */ modes = display->display_modes; nmodes = display->num_display_modes; - for (i = nmodes; i--;) { - if (SDL_memcmp(mode, &modes[i], sizeof(*mode)) == 0) { + for (i = 0; i < nmodes; ++i) { + if (cmpmodes(mode, &modes[i]) == 0) { return SDL_FALSE; } } @@ -1011,12 +1015,12 @@ int SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode) { SDL_DisplayMode fullscreen_mode; - SDL_VideoDisplay *display; + SDL_VideoDisplay *display; if (!mode) { return SDL_InvalidParamError("mode"); } - + CHECK_WINDOW_MAGIC(window, -1); fullscreen_mode = window->fullscreen_mode; @@ -1026,15 +1030,15 @@ SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode) 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), + 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"); @@ -1108,13 +1112,13 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) 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); + /* 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); } @@ -1211,6 +1215,10 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) } } 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; @@ -1249,7 +1257,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) 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)); @@ -1266,6 +1274,10 @@ SDL_CreateWindowFrom(const void *data) 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; @@ -1288,6 +1300,7 @@ 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"); @@ -1326,6 +1339,7 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) } window->title = NULL; + window->icon = NULL; window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN); if (_this->CreateWindow && !(flags & SDL_WINDOW_FOREIGN)) { @@ -1341,6 +1355,10 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) SDL_SetWindowTitle(window, title); SDL_free(title); } + if (icon) { + SDL_SetWindowIcon(window, icon); + SDL_FreeSurface(icon); + } SDL_FinishWindowCreation(window, flags); return 0; @@ -1417,8 +1435,18 @@ SDL_SetWindowIcon(SDL_Window * window, SDL_Surface * 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, icon); + _this->SetWindowIcon(_this, window, window->icon); } } @@ -1428,7 +1456,7 @@ 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"); @@ -1495,12 +1523,6 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y) { CHECK_WINDOW_MAGIC(window, ); - if (!SDL_WINDOWPOS_ISUNDEFINED(x)) { - window->x = x; - } - if (!SDL_WINDOWPOS_ISUNDEFINED(y)) { - window->y = y; - } if (SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); int displayIndex; @@ -1509,12 +1531,20 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y) displayIndex = SDL_GetIndexOfDisplay(display); SDL_GetDisplayBounds(displayIndex, &bounds); if (SDL_WINDOWPOS_ISCENTERED(x)) { - window->x = bounds.x + (bounds.w - window->w) / 2; + x = bounds.x + (bounds.w - window->w) / 2; } if (SDL_WINDOWPOS_ISCENTERED(y)) { - window->y = bounds.y + (bounds.h - window->h) / 2; + 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); @@ -1600,7 +1630,7 @@ SDL_GetWindowSize(SDL_Window * window, int *w, int *h) } if (h) { *h = window->h; - } + } } void @@ -1615,7 +1645,7 @@ SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h) SDL_InvalidParamError("min_h"); return; } - + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { window->min_w = min_w; window->min_h = min_h; @@ -1651,7 +1681,7 @@ SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h) SDL_InvalidParamError("max_h"); return; } - + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { window->max_w = max_w; window->max_h = max_h; @@ -1729,6 +1759,8 @@ SDL_MaximizeWindow(SDL_Window * window) return; } + // !!! FIXME: should this check if the window is resizable? + if (_this->MaximizeWindow) { _this->MaximizeWindow(_this, window); } @@ -1770,14 +1802,14 @@ SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags) { CHECK_WINDOW_MAGIC(window, -1); - flags &= FULLSCREEN_MASK; - + 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; + + /* clear the previous flags and OR in the new ones */ + window->flags &= ~FULLSCREEN_MASK; window->flags |= flags; SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window)); @@ -2031,27 +2063,47 @@ SDL_OnWindowRestored(SDL_Window * window) } } +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; + 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 @@ -2063,9 +2115,9 @@ SDL_OnWindowFocusLost(SDL_Window * window) SDL_UpdateWindowGrab(window); - /* If we're fullscreen on a single-head system and lose focus, minimize */ - if ((window->flags & SDL_WINDOW_FULLSCREEN) && ShouldMinimizeOnFocusLoss() ) { - SDL_MinimizeWindow(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); } } @@ -2136,6 +2188,9 @@ SDL_DestroyWindow(SDL_Window * window) if (window->title) { SDL_free(window->title); } + if (window->icon) { + SDL_FreeSurface(window->icon); + } if (window->gamma) { SDL_free(window->gamma); } @@ -2209,10 +2264,10 @@ SDL_VideoQuit(void) } /* Halt event processing before doing anything else */ - SDL_QuitQuit(); + SDL_TouchQuit(); SDL_MouseQuit(); SDL_KeyboardQuit(); - SDL_StopEventLoop(); + SDL_QuitSubSystem(SDL_INIT_EVENTS); SDL_EnableScreenSaver(); @@ -2222,7 +2277,7 @@ SDL_VideoQuit(void) } _this->VideoQuit(_this); - for (i = _this->num_displays; i--;) { + 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) { @@ -2323,6 +2378,12 @@ SDL_GL_UnloadLibrary(void) } } +static __inline__ SDL_bool +isAtLeastGL3(const char *verstr) +{ + return ( verstr && (SDL_atoi(verstr) >= 3) ); +} + SDL_bool SDL_GL_ExtensionSupported(const char *extension) { @@ -2342,13 +2403,43 @@ SDL_GL_ExtensionSupported(const char *extension) if (start && *start == '0') { return SDL_FALSE; } + /* Lookup the available extensions */ + glGetStringFunc = SDL_GL_GetProcAddress("glGetString"); - if (glGetStringFunc) { - extensions = (const char *) glGetStringFunc(GL_EXTENSIONS); - } else { - extensions = NULL; + 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; } @@ -2450,27 +2541,27 @@ SDL_GL_SetAttribute(SDL_GLattr attr, int 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; - } + 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; - } + 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; + break; default: retval = SDL_SetError("Unknown OpenGL attribute"); break; @@ -2669,9 +2760,12 @@ SDL_GL_CreateContext(SDL_Window * window) ctx = _this->GL_CreateContext(_this, window); /* Creating a context is assumed to make it current in the SDL driver. */ - _this->current_glwin = window; - _this->current_glctx = ctx; - + 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; } @@ -2680,34 +2774,58 @@ SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx) { int retval; - CHECK_WINDOW_MAGIC(window, -1); - - if (!(window->flags & SDL_WINDOW_OPENGL)) { - return SDL_SetError("The specified window isn't an OpenGL window"); + if (window == SDL_GL_GetCurrentWindow() && + ctx == SDL_GL_GetCurrentContext()) { + /* We're already current. */ + return 0; } + if (!ctx) { window = NULL; - } - - if ((window == _this->current_glwin) && (ctx == _this->current_glctx)) { - retval = 0; /* we're already current. */ } else { - retval = _this->GL_MakeCurrent(_this, window, ctx); - if (retval == 0) { - _this->current_glwin = window; - _this->current_glctx = ctx; + 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; } +SDL_Window * +SDL_GL_GetCurrentWindow(void) +{ + if (!_this) { + SDL_UninitializedVideo(); + return NULL; + } + return (SDL_Window *)SDL_TLSGet(_this->current_glwin_tls); +} + +SDL_GLContext +SDL_GL_GetCurrentContext(void) +{ + if (!_this) { + SDL_UninitializedVideo(); + return NULL; + } + return (SDL_GLContext)SDL_TLSGet(_this->current_glctx_tls); +} + int SDL_GL_SetSwapInterval(int interval) { if (!_this) { return SDL_UninitializedVideo(); - } else if (_this->current_glctx == NULL) { + } 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); @@ -2721,7 +2839,7 @@ SDL_GL_GetSwapInterval(void) { if (!_this) { return 0; - } else if (_this->current_glctx == NULL) { + } else if (SDL_GL_GetCurrentContext() == NULL) { return 0; } else if (_this->GL_GetSwapInterval) { return _this->GL_GetSwapInterval(_this); @@ -2739,6 +2857,12 @@ SDL_GL_SwapWindow(SDL_Window * window) 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); } @@ -2748,11 +2872,15 @@ SDL_GL_DeleteContext(SDL_GLContext context) if (!_this || !context) { return; } - _this->GL_MakeCurrent(_this, NULL, NULL); + + if (SDL_GL_GetCurrentContext() == context) { + SDL_GL_MakeCurrent(NULL, NULL); + } + _this->GL_DeleteContext(_this, context); } -#if 0 // FIXME +#if 0 /* FIXME */ /* * Utility function used by SDL_WM_SetIcon(); flags & 1 for color key, flags * & 2 for alpha channel. @@ -2763,7 +2891,7 @@ 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))) + mask[(y*((icon->w+7)/8))+(x/8)] &= ~(0x01<<(7-(x%8))) colorkey = icon->format->colorkey; switch (icon->format->BytesPerPixel) { @@ -2878,8 +3006,8 @@ SDL_StartTextInput(void) /* Then show the on-screen keyboard, if any */ window = SDL_GetFocusWindow(); - if (window && _this && _this->SDL_ShowScreenKeyboard) { - _this->SDL_ShowScreenKeyboard(_this, window); + if (window && _this && _this->ShowScreenKeyboard) { + _this->ShowScreenKeyboard(_this, window); } /* Finally start the text input system */ @@ -2906,8 +3034,8 @@ SDL_StopTextInput(void) /* Hide the on-screen keyboard, if any */ window = SDL_GetFocusWindow(); - if (window && _this && _this->SDL_HideScreenKeyboard) { - _this->SDL_HideScreenKeyboard(_this, window); + if (window && _this && _this->HideScreenKeyboard) { + _this->HideScreenKeyboard(_this, window); } /* Finally disable text events */ @@ -2926,8 +3054,8 @@ SDL_SetTextInputRect(SDL_Rect *rect) SDL_bool SDL_HasScreenKeyboardSupport(void) { - if (_this && _this->SDL_HasScreenKeyboardSupport) { - return _this->SDL_HasScreenKeyboardSupport(_this); + if (_this && _this->HasScreenKeyboardSupport) { + return _this->HasScreenKeyboardSupport(_this); } return SDL_FALSE; } @@ -2935,8 +3063,8 @@ SDL_HasScreenKeyboardSupport(void) SDL_bool SDL_IsScreenKeyboardShown(SDL_Window *window) { - if (window && _this && _this->SDL_IsScreenKeyboardShown) { - return _this->SDL_IsScreenKeyboardShown(_this, window); + if (window && _this && _this->IsScreenKeyboardShown) { + return _this->IsScreenKeyboardShown(_this, window); } return SDL_FALSE; } @@ -2954,53 +3082,83 @@ SDL_IsScreenKeyboardShown(SDL_Window *window) #include "x11/SDL_x11messagebox.h" #endif +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); + } +} + int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { int dummybutton; - int retval = -1; - SDL_bool relative_mode = SDL_GetRelativeMouseMode(); - int show_cursor_prev = SDL_ShowCursor( 1 ); + int retval = -1; + SDL_bool relative_mode; + int show_cursor_prev; - SDL_SetRelativeMouseMode( SDL_FALSE ); + 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) { - if (_this->ShowMessageBox(_this, messageboxdata, buttonid) == 0) { - retval = 0; - } + 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) && (WIN_ShowMessageBox(messageboxdata, buttonid) == 0)) { + 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) && (Cocoa_ShowMessageBox(messageboxdata, buttonid) == 0)) { + 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) && (UIKit_ShowMessageBox(messageboxdata, buttonid) == 0)) { + 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) && (X11_ShowMessageBox(messageboxdata, buttonid) == 0)) { + 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"); + } - SDL_ShowCursor( show_cursor_prev ); - SDL_SetRelativeMouseMode( relative_mode ); + SDL_ShowCursor(show_cursor_prev); + SDL_SetRelativeMouseMode(relative_mode); - if(retval == -1) { - SDL_SetError("No message system available"); - } return retval; } @@ -3027,17 +3185,17 @@ SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, S } SDL_bool -SDL_ShouldAllowTopmost() +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; + 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/android/SDL_androidclipboard.c b/src/video/android/SDL_androidclipboard.c index ef57b8d3f..19a70a305 100644 --- a/src/video/android/SDL_androidclipboard.c +++ b/src/video/android/SDL_androidclipboard.c @@ -29,18 +29,20 @@ int Android_SetClipboardText(_THIS, const char *text) { - return Android_JNI_SetClipboardText(text); + return Android_JNI_SetClipboardText(text); } char * Android_GetClipboardText(_THIS) { - return Android_JNI_GetClipboardText(); + return Android_JNI_GetClipboardText(); } SDL_bool Android_HasClipboardText(_THIS) { - return Android_JNI_HasClipboardText(); + 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 index 48d14834a..d1cdaf1c4 100644 --- a/src/video/android/SDL_androidclipboard.h +++ b/src/video/android/SDL_androidclipboard.h @@ -28,3 +28,5 @@ 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_androidgl.c b/src/video/android/SDL_androidgl.c index 1382b8878..6902bc1d0 100644 --- a/src/video/android/SDL_androidgl.c +++ b/src/video/android/SDL_androidgl.c @@ -119,7 +119,9 @@ Android_GL_SwapWindow(_THIS, SDL_Window * window) void Android_GL_DeleteContext(_THIS, SDL_GLContext context) { - __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n"); + if (context) { + Android_JNI_DeleteContext(); + } } #endif /* SDL_VIDEO_DRIVER_ANDROID */ diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c index d306453e2..5381de64d 100644 --- a/src/video/android/SDL_androidkeyboard.c +++ b/src/video/android/SDL_androidkeyboard.c @@ -28,8 +28,9 @@ #include "SDL_androidkeyboard.h" +#include "../../core/android/SDL_android.h" -void Android_InitKeyboard() +void Android_InitKeyboard(void) { SDL_Keycode keymap[SDL_NUM_SCANCODES]; @@ -259,6 +260,8 @@ static SDL_Scancode Android_Keycodes[] = { 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 @@ -321,7 +324,7 @@ Android_SetTextInputRect(_THIS, SDL_Rect *rect) SDL_InvalidParamError("rect"); return; } - + videodata->textRect = *rect; } diff --git a/src/video/android/SDL_androidkeyboard.h b/src/video/android/SDL_androidkeyboard.h index dc670e858..da8da9b75 100644 --- a/src/video/android/SDL_androidkeyboard.h +++ b/src/video/android/SDL_androidkeyboard.h @@ -22,7 +22,7 @@ #include "SDL_androidvideo.h" -extern void Android_InitKeyboard(); +extern void Android_InitKeyboard(void); extern int Android_OnKeyDown(int keycode); extern int Android_OnKeyUp(int keycode); diff --git a/src/video/android/SDL_androidtouch.c b/src/video/android/SDL_androidtouch.c index c8d5ae6d5..3265b54eb 100644 --- a/src/video/android/SDL_androidtouch.c +++ b/src/video/android/SDL_androidtouch.c @@ -27,6 +27,7 @@ #include "SDL_events.h" #include "../../events/SDL_mouse_c.h" #include "../../events/SDL_touch_c.h" +#include "SDL_log.h" #include "SDL_androidtouch.h" @@ -36,7 +37,7 @@ #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 +/* 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 @@ -52,7 +53,7 @@ static void Android_GetWindowCoordinates(float x, float y, *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) +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; @@ -104,7 +105,7 @@ void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int actio break; default: break; - } + } } #endif /* SDL_VIDEO_DRIVER_ANDROID */ diff --git a/src/video/android/SDL_androidvideo.c b/src/video/android/SDL_androidvideo.c index d9c2b4efa..6dcb81e70 100644 --- a/src/video/android/SDL_androidvideo.c +++ b/src/video/android/SDL_androidvideo.c @@ -48,7 +48,6 @@ static void Android_VideoQuit(_THIS); 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 int *Android_GL_GetVisual(_THIS, Display * display, int screen); extern SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window); extern int Android_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); @@ -60,8 +59,7 @@ 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()) +/* 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; @@ -85,7 +83,6 @@ Android_DeleteDevice(SDL_VideoDevice * device) static SDL_VideoDevice * Android_CreateDevice(int devindex) { - printf("Creating video device\n"); SDL_VideoDevice *device; SDL_VideoData *data; @@ -133,8 +130,8 @@ Android_CreateDevice(int devindex) device->SetTextInputRect = Android_SetTextInputRect; /* Screen keyboard */ - device->SDL_HasScreenKeyboardSupport = Android_HasScreenKeyboardSupport; - device->SDL_IsScreenKeyboardShown = Android_IsScreenKeyboardShown; + device->HasScreenKeyboardSupport = Android_HasScreenKeyboardSupport; + device->IsScreenKeyboardShown = Android_IsScreenKeyboardShown; /* Clipboard */ device->SetClipboardText = Android_SetClipboardText; @@ -182,7 +179,7 @@ void Android_SetScreenResolution(int width, int height, Uint32 format) { Android_ScreenWidth = width; - Android_ScreenHeight = height; + Android_ScreenHeight = height; Android_ScreenFormat = format; if (Android_Window) { diff --git a/src/video/android/SDL_androidwindow.c b/src/video/android/SDL_androidwindow.c index 7d13a26d3..70e244e1a 100644 --- a/src/video/android/SDL_androidwindow.c +++ b/src/video/android/SDL_androidwindow.c @@ -23,10 +23,14 @@ #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) { @@ -47,7 +51,7 @@ Android_CreateWindow(_THIS, SDL_Window * window) 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 */ + window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */ /* One window, it always has focus */ SDL_SetMouseFocus(window); diff --git a/src/video/bwindow/SDL_BWin.h b/src/video/bwindow/SDL_BWin.h index 9d7a273b0..fb576da68 100644 --- a/src/video/bwindow/SDL_BWin.h +++ b/src/video/bwindow/SDL_BWin.h @@ -47,23 +47,23 @@ extern "C" { enum WinCommands { - BWIN_MOVE_WINDOW, - BWIN_RESIZE_WINDOW, - BWIN_SHOW_WINDOW, - BWIN_HIDE_WINDOW, - BWIN_MAXIMIZE_WINDOW, - BWIN_MINIMIZE_WINDOW, - BWIN_RESTORE_WINDOW, - BWIN_SET_TITLE, - BWIN_SET_BORDERED, - BWIN_FULLSCREEN + BWIN_MOVE_WINDOW, + BWIN_RESIZE_WINDOW, + BWIN_SHOW_WINDOW, + BWIN_HIDE_WINDOW, + BWIN_MAXIMIZE_WINDOW, + BWIN_MINIMIZE_WINDOW, + BWIN_RESTORE_WINDOW, + BWIN_SET_TITLE, + BWIN_SET_BORDERED, + BWIN_FULLSCREEN }; class SDL_BWin:public BDirectWindow { public: - /* Constructor/Destructor */ + /* Constructor/Destructor */ SDL_BWin(BRect bounds, window_look look, uint32 flags) : BDirectWindow(bounds, "Untitled", look, B_NORMAL_WINDOW_FEEL, flags) { @@ -85,7 +85,7 @@ class SDL_BWin:public BDirectWindow _bitmap = NULL; #ifdef DRAWTHREAD _draw_thread_id = spawn_thread(BE_DrawThread, "drawing_thread", - B_NORMAL_PRIORITY, (void*) this); + B_NORMAL_PRIORITY, (void*) this); resume_thread(_draw_thread_id); #endif } @@ -95,22 +95,22 @@ class SDL_BWin:public BDirectWindow Lock(); _connection_disabled = true; int32 result; - + #if SDL_VIDEO_OPENGL if (_SDL_GLView) { _SDL_GLView->UnlockGL(); - RemoveChild(_SDL_GLView); /* Why was this outside the if - statement before? */ + RemoveChild(_SDL_GLView); /* Why was this outside the if + statement before? */ } - -#endif + +#endif Unlock(); #if SDL_VIDEO_OPENGL if (_SDL_GLView) { delete _SDL_GLView; } #endif - + /* Clean up framebuffer stuff */ _buffer_locker->Lock(); #ifdef DRAWTHREAD @@ -119,7 +119,7 @@ class SDL_BWin:public BDirectWindow free(_clips); delete _buffer_locker; } - + /* * * * * OpenGL functionality * * * * */ #if SDL_VIDEO_OPENGL @@ -133,186 +133,186 @@ class SDL_BWin:public BDirectWindow } AddChild(_SDL_GLView); _SDL_GLView->EnableDirectMode(true); - _SDL_GLView->LockGL(); /* "New" GLViews are created */ + _SDL_GLView->LockGL(); /* "New" GLViews are created */ Unlock(); return (_SDL_GLView); } - + virtual void RemoveGLView() { - Lock(); - if(_SDL_GLView) { - _SDL_GLView->UnlockGL(); - RemoveChild(_SDL_GLView); - } - Unlock(); + Lock(); + if(_SDL_GLView) { + _SDL_GLView->UnlockGL(); + RemoveChild(_SDL_GLView); + } + Unlock(); } - + virtual void SwapBuffers(void) { - _SDL_GLView->UnlockGL(); - _SDL_GLView->LockGL(); - _SDL_GLView->SwapBuffers(); - } + _SDL_GLView->UnlockGL(); + _SDL_GLView->LockGL(); + _SDL_GLView->SwapBuffers(); + } #endif - + /* * * * * Framebuffering* * * * */ virtual void DirectConnected(direct_buffer_info *info) { - if(!_connected && _connection_disabled) { - return; - } + if(!_connected && _connection_disabled) { + return; + } - /* Determine if the pixel buffer is usable after this update */ - _trash_window_buffer = _trash_window_buffer - || ((info->buffer_state & B_BUFFER_RESIZED) - || (info->buffer_state & B_BUFFER_RESET) - || (info->driver_state == B_MODE_CHANGED)); - LockBuffer(); + /* Determine if the pixel buffer is usable after this update */ + _trash_window_buffer = _trash_window_buffer + || ((info->buffer_state & B_BUFFER_RESIZED) + || (info->buffer_state & B_BUFFER_RESET) + || (info->driver_state == B_MODE_CHANGED)); + LockBuffer(); - switch(info->buffer_state & B_DIRECT_MODE_MASK) { - case B_DIRECT_START: - _connected = true; + switch(info->buffer_state & B_DIRECT_MODE_MASK) { + case B_DIRECT_START: + _connected = true; - case B_DIRECT_MODIFY: - if(_clips) { - free(_clips); - _clips = NULL; - } - - _num_clips = info->clip_list_count; - _clips = (clipping_rect *)malloc(_num_clips*sizeof(clipping_rect)); - if(_clips) { - memcpy(_clips, info->clip_list, - _num_clips*sizeof(clipping_rect)); - - _bits = (uint8*) info->bits; - _row_bytes = info->bytes_per_row; - _bounds = info->window_bounds; - _bytes_per_px = info->bits_per_pixel / 8; - _buffer_dirty = true; - } - break; + case B_DIRECT_MODIFY: + if(_clips) { + free(_clips); + _clips = NULL; + } - case B_DIRECT_STOP: - _connected = false; - break; - } + _num_clips = info->clip_list_count; + _clips = (clipping_rect *)malloc(_num_clips*sizeof(clipping_rect)); + if(_clips) { + memcpy(_clips, info->clip_list, + _num_clips*sizeof(clipping_rect)); + + _bits = (uint8*) info->bits; + _row_bytes = info->bytes_per_row; + _bounds = info->window_bounds; + _bytes_per_px = info->bits_per_pixel / 8; + _buffer_dirty = true; + } + break; + + case B_DIRECT_STOP: + _connected = false; + break; + } #if SDL_VIDEO_OPENGL - if(_SDL_GLView) { - _SDL_GLView->DirectConnected(info); - } + if(_SDL_GLView) { + _SDL_GLView->DirectConnected(info); + } #endif - - - /* Call the base object directconnected */ - BDirectWindow::DirectConnected(info); - - UnlockBuffer(); - + + + /* Call the base object directconnected */ + BDirectWindow::DirectConnected(info); + + UnlockBuffer(); + } - - - - + + + + /* * * * * Event sending * * * * */ /* Hook functions */ virtual void FrameMoved(BPoint origin) { - /* Post a message to the BApp so that it can handle the window event */ - BMessage msg(BAPP_WINDOW_MOVED); - msg.AddInt32("window-x", (int)origin.x); - msg.AddInt32("window-y", (int)origin.y); - _PostWindowEvent(msg); - - /* Perform normal hook operations */ - BDirectWindow::FrameMoved(origin); + /* Post a message to the BApp so that it can handle the window event */ + BMessage msg(BAPP_WINDOW_MOVED); + msg.AddInt32("window-x", (int)origin.x); + msg.AddInt32("window-y", (int)origin.y); + _PostWindowEvent(msg); + + /* Perform normal hook operations */ + BDirectWindow::FrameMoved(origin); } - + virtual void FrameResized(float width, float height) { - /* Post a message to the BApp so that it can handle the window event */ - BMessage msg(BAPP_WINDOW_RESIZED); + /* Post a message to the BApp so that it can handle the window event */ + BMessage msg(BAPP_WINDOW_RESIZED); - msg.AddInt32("window-w", (int)width + 1); - msg.AddInt32("window-h", (int)height + 1); - _PostWindowEvent(msg); - - /* Perform normal hook operations */ - BDirectWindow::FrameResized(width, height); + msg.AddInt32("window-w", (int)width + 1); + msg.AddInt32("window-h", (int)height + 1); + _PostWindowEvent(msg); + + /* Perform normal hook operations */ + BDirectWindow::FrameResized(width, height); } - virtual bool QuitRequested() { - BMessage msg(BAPP_WINDOW_CLOSE_REQUESTED); - _PostWindowEvent(msg); + virtual bool QuitRequested() { + BMessage msg(BAPP_WINDOW_CLOSE_REQUESTED); + _PostWindowEvent(msg); - /* We won't allow a quit unless asked by DestroyWindow() */ - return false; + /* We won't allow a quit unless asked by DestroyWindow() */ + return false; } - + virtual void WindowActivated(bool active) { - BMessage msg(BAPP_KEYBOARD_FOCUS); /* Mouse focus sold separately */ - _PostWindowEvent(msg); + BMessage msg(BAPP_KEYBOARD_FOCUS); /* Mouse focus sold separately */ + _PostWindowEvent(msg); } - - virtual void Zoom(BPoint origin, - float width, - float height) { - BMessage msg(BAPP_MAXIMIZE); /* Closest thing to maximization Haiku has */ - _PostWindowEvent(msg); - - /* Before the window zooms, record its size */ - if( !_prev_frame ) - _prev_frame = new BRect(Frame()); - /* Perform normal hook operations */ - BDirectWindow::Zoom(origin, width, height); + virtual void Zoom(BPoint origin, + float width, + float height) { + BMessage msg(BAPP_MAXIMIZE); /* Closest thing to maximization Haiku has */ + _PostWindowEvent(msg); + + /* Before the window zooms, record its size */ + if( !_prev_frame ) + _prev_frame = new BRect(Frame()); + + /* Perform normal hook operations */ + BDirectWindow::Zoom(origin, width, height); } - + /* Member functions */ virtual void Show() { - while(IsHidden()) { - BDirectWindow::Show(); - } - _shown = true; + while(IsHidden()) { + BDirectWindow::Show(); + } + _shown = true; - BMessage msg(BAPP_SHOW); - _PostWindowEvent(msg); + BMessage msg(BAPP_SHOW); + _PostWindowEvent(msg); } - - virtual void Hide() { - BDirectWindow::Hide(); - _shown = false; - BMessage msg(BAPP_HIDE); - _PostWindowEvent(msg); + virtual void Hide() { + BDirectWindow::Hide(); + _shown = false; + + BMessage msg(BAPP_HIDE); + _PostWindowEvent(msg); } virtual void Minimize(bool minimize) { - BDirectWindow::Minimize(minimize); - int32 minState = (minimize ? BAPP_MINIMIZE : BAPP_RESTORE); - - BMessage msg(minState); - _PostWindowEvent(msg); + BDirectWindow::Minimize(minimize); + int32 minState = (minimize ? BAPP_MINIMIZE : BAPP_RESTORE); + + BMessage msg(minState); + _PostWindowEvent(msg); } - - + + /* BView message interruption */ virtual void DispatchMessage(BMessage * msg, BHandler * target) { - BPoint where; /* Used by mouse moved */ - int32 buttons; /* Used for mouse button events */ - int32 key; /* Used for key events */ - + BPoint where; /* Used by mouse moved */ + int32 buttons; /* Used for mouse button events */ + int32 key; /* Used for key events */ + switch (msg->what) { case B_MOUSE_MOVED: int32 transit; if (msg->FindPoint("where", &where) == B_OK && msg->FindInt32("be:transit", &transit) == B_OK) { - _MouseMotionEvent(where, transit); + _MouseMotionEvent(where, transit); } - + /* FIXME: Apparently a button press/release event might be dropped if made before before a different button is released. Does B_MOUSE_MOVED have the data needed to check if a mouse button state has changed? */ if (msg->FindInt32("buttons", &buttons) == B_OK) { - _MouseButtonEvent(buttons); + _MouseButtonEvent(buttons); } break; @@ -321,32 +321,32 @@ class SDL_BWin:public BDirectWindow /* _MouseButtonEvent() detects any and all buttons that may have changed state, as well as that button's new state */ if (msg->FindInt32("buttons", &buttons) == B_OK) { - _MouseButtonEvent(buttons); + _MouseButtonEvent(buttons); } break; case B_MOUSE_WHEEL_CHANGED: - float x, y; - if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK - && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) { - _MouseWheelEvent((int)x, (int)y); - } - break; + float x, y; + if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK + && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) { + _MouseWheelEvent((int)x, (int)y); + } + break; case B_KEY_DOWN: case B_UNMAPPED_KEY_DOWN: /* modifier keys are unmapped */ - if (msg->FindInt32("key", &key) == B_OK) { - _KeyEvent((SDL_Scancode)key, SDL_PRESSED); - } - break; + if (msg->FindInt32("key", &key) == B_OK) { + _KeyEvent((SDL_Scancode)key, SDL_PRESSED); + } + break; case B_KEY_UP: case B_UNMAPPED_KEY_UP: /* modifier keys are unmapped */ - if (msg->FindInt32("key", &key) == B_OK) { - _KeyEvent(key, SDL_RELEASED); + if (msg->FindInt32("key", &key) == B_OK) { + _KeyEvent(key, SDL_RELEASED); } break; - + default: /* move it after switch{} so it's always handled that way we keep BeOS feautures like: @@ -359,263 +359,263 @@ class SDL_BWin:public BDirectWindow BDirectWindow::DispatchMessage(msg, target); } - + /* Handle command messages */ virtual void MessageReceived(BMessage* message) { - switch (message->what) { - /* Handle commands from SDL */ - case BWIN_SET_TITLE: - _SetTitle(message); - break; - case BWIN_MOVE_WINDOW: - _MoveTo(message); - break; - case BWIN_RESIZE_WINDOW: - _ResizeTo(message); - break; - case BWIN_SET_BORDERED: - _SetBordered(message); - break; - case BWIN_SHOW_WINDOW: - Show(); - break; - case BWIN_HIDE_WINDOW: - Hide(); - break; - case BWIN_MAXIMIZE_WINDOW: - BWindow::Zoom(); - break; - case BWIN_MINIMIZE_WINDOW: - Minimize(true); - break; - case BWIN_RESTORE_WINDOW: - _Restore(); - break; - case BWIN_FULLSCREEN: - _SetFullScreen(message); - break; - default: - /* Perform normal message handling */ - BDirectWindow::MessageReceived(message); - break; - } + switch (message->what) { + /* Handle commands from SDL */ + case BWIN_SET_TITLE: + _SetTitle(message); + break; + case BWIN_MOVE_WINDOW: + _MoveTo(message); + break; + case BWIN_RESIZE_WINDOW: + _ResizeTo(message); + break; + case BWIN_SET_BORDERED: + _SetBordered(message); + break; + case BWIN_SHOW_WINDOW: + Show(); + break; + case BWIN_HIDE_WINDOW: + Hide(); + break; + case BWIN_MAXIMIZE_WINDOW: + BWindow::Zoom(); + break; + case BWIN_MINIMIZE_WINDOW: + Minimize(true); + break; + case BWIN_RESTORE_WINDOW: + _Restore(); + break; + case BWIN_FULLSCREEN: + _SetFullScreen(message); + break; + default: + /* Perform normal message handling */ + BDirectWindow::MessageReceived(message); + break; + } } - - - /* Accessor methods */ - bool IsShown() { return _shown; } - int32 GetID() { return _id; } - uint32 GetRowBytes() { return _row_bytes; } - int32 GetFbX() { return _bounds.left; } - int32 GetFbY() { return _bounds.top; } - bool ConnectionEnabled() { return !_connection_disabled; } - bool Connected() { return _connected; } - clipping_rect *GetClips() { return _clips; } - int32 GetNumClips() { return _num_clips; } - uint8* GetBufferPx() { return _bits; } - int32 GetBytesPerPx() { return _bytes_per_px; } - bool CanTrashWindowBuffer() { return _trash_window_buffer; } - bool BufferExists() { return _buffer_created; } - bool BufferIsDirty() { return _buffer_dirty; } - BBitmap *GetBitmap() { return _bitmap; } + + + /* Accessor methods */ + bool IsShown() { return _shown; } + int32 GetID() { return _id; } + uint32 GetRowBytes() { return _row_bytes; } + int32 GetFbX() { return _bounds.left; } + int32 GetFbY() { return _bounds.top; } + bool ConnectionEnabled() { return !_connection_disabled; } + bool Connected() { return _connected; } + clipping_rect *GetClips() { return _clips; } + int32 GetNumClips() { return _num_clips; } + uint8* GetBufferPx() { return _bits; } + int32 GetBytesPerPx() { return _bytes_per_px; } + bool CanTrashWindowBuffer() { return _trash_window_buffer; } + bool BufferExists() { return _buffer_created; } + bool BufferIsDirty() { return _buffer_dirty; } + BBitmap *GetBitmap() { return _bitmap; } #if SDL_VIDEO_OPENGL - BGLView *GetGLView() { return _SDL_GLView; } + BGLView *GetGLView() { return _SDL_GLView; } #endif - - /* Setter methods */ - void SetID(int32 id) { _id = id; } - void SetBufferExists(bool bufferExists) { _buffer_created = bufferExists; } - void LockBuffer() { _buffer_locker->Lock(); } - void UnlockBuffer() { _buffer_locker->Unlock(); } - void SetBufferDirty(bool bufferDirty) { _buffer_dirty = bufferDirty; } - void SetTrashBuffer(bool trash) { _trash_window_buffer = trash; } - void SetBitmap(BBitmap *bitmap) { _bitmap = bitmap; } - - + + /* Setter methods */ + void SetID(int32 id) { _id = id; } + void SetBufferExists(bool bufferExists) { _buffer_created = bufferExists; } + void LockBuffer() { _buffer_locker->Lock(); } + void UnlockBuffer() { _buffer_locker->Unlock(); } + void SetBufferDirty(bool bufferDirty) { _buffer_dirty = bufferDirty; } + void SetTrashBuffer(bool trash) { _trash_window_buffer = trash; } + void SetBitmap(BBitmap *bitmap) { _bitmap = bitmap; } + + private: - /* Event redirection */ + /* Event redirection */ void _MouseMotionEvent(BPoint &where, int32 transit) { - if(transit == B_EXITED_VIEW) { - /* Change mouse focus */ - if(_mouse_focused) { - _MouseFocusEvent(false); - } - } else { - /* Change mouse focus */ - if (!_mouse_focused) { - _MouseFocusEvent(true); - } - BMessage msg(BAPP_MOUSE_MOVED); - msg.AddInt32("x", (int)where.x); - msg.AddInt32("y", (int)where.y); - - _PostWindowEvent(msg); - } + if(transit == B_EXITED_VIEW) { + /* Change mouse focus */ + if(_mouse_focused) { + _MouseFocusEvent(false); + } + } else { + /* Change mouse focus */ + if (!_mouse_focused) { + _MouseFocusEvent(true); + } + BMessage msg(BAPP_MOUSE_MOVED); + msg.AddInt32("x", (int)where.x); + msg.AddInt32("y", (int)where.y); + + _PostWindowEvent(msg); + } } - + void _MouseFocusEvent(bool focusGained) { - _mouse_focused = focusGained; - BMessage msg(BAPP_MOUSE_FOCUS); - msg.AddBool("focusGained", focusGained); - _PostWindowEvent(msg); - + _mouse_focused = focusGained; + BMessage msg(BAPP_MOUSE_FOCUS); + msg.AddBool("focusGained", focusGained); + _PostWindowEvent(msg); + //FIXME: Why were these here? // if false: be_app->SetCursor(B_HAND_CURSOR); // if true: SDL_SetCursor(NULL); } - + void _MouseButtonEvent(int32 buttons) { - int32 buttonStateChange = buttons ^ _last_buttons; - - /* Make sure at least one button has changed state */ - if( !(buttonStateChange) ) { - return; - } - - /* Add any mouse button events */ - if(buttonStateChange & B_PRIMARY_MOUSE_BUTTON) { - _SendMouseButton(SDL_BUTTON_LEFT, buttons & - B_PRIMARY_MOUSE_BUTTON); - } - if(buttonStateChange & B_SECONDARY_MOUSE_BUTTON) { - _SendMouseButton(SDL_BUTTON_RIGHT, buttons & - B_PRIMARY_MOUSE_BUTTON); - } - if(buttonStateChange & B_TERTIARY_MOUSE_BUTTON) { - _SendMouseButton(SDL_BUTTON_MIDDLE, buttons & - B_PRIMARY_MOUSE_BUTTON); - } - - _last_buttons = buttons; + int32 buttonStateChange = buttons ^ _last_buttons; + + /* Make sure at least one button has changed state */ + if( !(buttonStateChange) ) { + return; + } + + /* Add any mouse button events */ + if(buttonStateChange & B_PRIMARY_MOUSE_BUTTON) { + _SendMouseButton(SDL_BUTTON_LEFT, buttons & + B_PRIMARY_MOUSE_BUTTON); + } + if(buttonStateChange & B_SECONDARY_MOUSE_BUTTON) { + _SendMouseButton(SDL_BUTTON_RIGHT, buttons & + B_PRIMARY_MOUSE_BUTTON); + } + if(buttonStateChange & B_TERTIARY_MOUSE_BUTTON) { + _SendMouseButton(SDL_BUTTON_MIDDLE, buttons & + B_PRIMARY_MOUSE_BUTTON); + } + + _last_buttons = buttons; } - + void _SendMouseButton(int32 button, int32 state) { - BMessage msg(BAPP_MOUSE_BUTTON); - msg.AddInt32("button-id", button); - msg.AddInt32("button-state", state); - _PostWindowEvent(msg); + BMessage msg(BAPP_MOUSE_BUTTON); + msg.AddInt32("button-id", button); + msg.AddInt32("button-state", state); + _PostWindowEvent(msg); } - + void _MouseWheelEvent(int32 x, int32 y) { - /* Create a message to pass along to the BeApp thread */ - BMessage msg(BAPP_MOUSE_WHEEL); - msg.AddInt32("xticks", x); - msg.AddInt32("yticks", y); - _PostWindowEvent(msg); + /* Create a message to pass along to the BeApp thread */ + BMessage msg(BAPP_MOUSE_WHEEL); + msg.AddInt32("xticks", x); + msg.AddInt32("yticks", y); + _PostWindowEvent(msg); } - + void _KeyEvent(int32 keyCode, int32 keyState) { - /* Create a message to pass along to the BeApp thread */ - BMessage msg(BAPP_KEY); - msg.AddInt32("key-state", keyState); - msg.AddInt32("key-scancode", keyCode); - be_app->PostMessage(&msg); - /* Apparently SDL only uses the scancode */ + /* Create a message to pass along to the BeApp thread */ + BMessage msg(BAPP_KEY); + msg.AddInt32("key-state", keyState); + msg.AddInt32("key-scancode", keyCode); + be_app->PostMessage(&msg); + /* Apparently SDL only uses the scancode */ } - + void _RepaintEvent() { - /* Force a repaint: Call the SDL exposed event */ - BMessage msg(BAPP_REPAINT); - _PostWindowEvent(msg); + /* Force a repaint: Call the SDL exposed event */ + BMessage msg(BAPP_REPAINT); + _PostWindowEvent(msg); } void _PostWindowEvent(BMessage &msg) { - msg.AddInt32("window-id", _id); - be_app->PostMessage(&msg); + msg.AddInt32("window-id", _id); + be_app->PostMessage(&msg); } - - /* Command methods (functions called upon by SDL) */ + + /* Command methods (functions called upon by SDL) */ void _SetTitle(BMessage *msg) { - const char *title; - if( - msg->FindString("window-title", &title) != B_OK - ) { - return; - } - SetTitle(title); + const char *title; + if( + msg->FindString("window-title", &title) != B_OK + ) { + return; + } + SetTitle(title); } - + void _MoveTo(BMessage *msg) { - int32 x, y; - if( - msg->FindInt32("window-x", &x) != B_OK || - msg->FindInt32("window-y", &y) != B_OK - ) { - return; - } - MoveTo(x, y); + int32 x, y; + if( + msg->FindInt32("window-x", &x) != B_OK || + msg->FindInt32("window-y", &y) != B_OK + ) { + return; + } + MoveTo(x, y); } - + void _ResizeTo(BMessage *msg) { - int32 w, h; - if( - msg->FindInt32("window-w", &w) != B_OK || - msg->FindInt32("window-h", &h) != B_OK - ) { - return; - } - ResizeTo(w, h); + int32 w, h; + if( + msg->FindInt32("window-w", &w) != B_OK || + msg->FindInt32("window-h", &h) != B_OK + ) { + return; + } + ResizeTo(w, h); } void _SetBordered(BMessage *msg) { - bool bEnabled; - if(msg->FindBool("window-border", &bEnabled) != B_OK) { - return; - } - SetLook(bEnabled ? B_BORDERED_WINDOW_LOOK : B_NO_BORDER_WINDOW_LOOK); + bool bEnabled; + if(msg->FindBool("window-border", &bEnabled) != B_OK) { + return; + } + SetLook(bEnabled ? B_BORDERED_WINDOW_LOOK : B_NO_BORDER_WINDOW_LOOK); } void _Restore() { - if(IsMinimized()) { - Minimize(false); - } else if(IsHidden()) { - Show(); - } else if(_prev_frame != NULL) { /* Zoomed */ - MoveTo(_prev_frame->left, _prev_frame->top); - ResizeTo(_prev_frame->Width(), _prev_frame->Height()); - } + if(IsMinimized()) { + Minimize(false); + } else if(IsHidden()) { + Show(); + } else if(_prev_frame != NULL) { /* Zoomed */ + MoveTo(_prev_frame->left, _prev_frame->top); + ResizeTo(_prev_frame->Width(), _prev_frame->Height()); + } } void _SetFullScreen(BMessage *msg) { - bool fullscreen; - if( - msg->FindBool("fullscreen", &fullscreen) != B_OK - ) { - return; - } - SetFullScreen(fullscreen); + bool fullscreen; + if( + msg->FindBool("fullscreen", &fullscreen) != B_OK + ) { + return; + } + SetFullScreen(fullscreen); } - + /* Members */ #if SDL_VIDEO_OPENGL BGLView * _SDL_GLView; #endif - + int32 _last_buttons; - int32 _id; /* Window id used by SDL_BApp */ - bool _mouse_focused; /* Does this window have mouse focus? */ + int32 _id; /* Window id used by SDL_BApp */ + bool _mouse_focused; /* Does this window have mouse focus? */ bool _shown; bool _inhibit_resize; - - BRect *_prev_frame; /* Previous position and size of the window */ - + + BRect *_prev_frame; /* Previous position and size of the window */ + /* Framebuffer members */ - bool _connected, - _connection_disabled, - _buffer_created, - _buffer_dirty, - _trash_window_buffer; - uint8 *_bits; - uint32 _row_bytes; - clipping_rect _bounds; - BLocker *_buffer_locker; + bool _connected, + _connection_disabled, + _buffer_created, + _buffer_dirty, + _trash_window_buffer; + uint8 *_bits; + uint32 _row_bytes; + clipping_rect _bounds; + BLocker *_buffer_locker; clipping_rect *_clips; - int32 _num_clips; - int32 _bytes_per_px; - thread_id _draw_thread_id; - - BBitmap *_bitmap; + int32 _num_clips; + int32 _bytes_per_px; + thread_id _draw_thread_id; + + BBitmap *_bitmap; }; diff --git a/src/video/bwindow/SDL_bevents.h b/src/video/bwindow/SDL_bevents.h index 66284283a..a83d03b52 100644 --- a/src/video/bwindow/SDL_bevents.h +++ b/src/video/bwindow/SDL_bevents.h @@ -17,7 +17,7 @@ 2. Altered source versions must be plainly marked as 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_BEVENTS_H #define SDL_BEVENTS_H diff --git a/src/video/bwindow/SDL_bmodes.cc b/src/video/bwindow/SDL_bmodes.cc index 2e8f4b577..41894fb78 100644 --- a/src/video/bwindow/SDL_bmodes.cc +++ b/src/video/bwindow/SDL_bmodes.cc @@ -275,7 +275,7 @@ void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { bscreen.GetMode(&this_bmode); for(i = 0; i < count; ++i) { - //FIXME: Apparently there are errors with colorspace changes + // FIXME: Apparently there are errors with colorspace changes if (bmodes[i].space == this_bmode.space) { _BDisplayModeToSdlDisplayMode(&bmodes[i], &mode); SDL_AddDisplayMode(display, &mode); diff --git a/src/video/bwindow/SDL_bmodes.h b/src/video/bwindow/SDL_bmodes.h index 5e723a801..9ca04d087 100644 --- a/src/video/bwindow/SDL_bmodes.h +++ b/src/video/bwindow/SDL_bmodes.h @@ -34,10 +34,10 @@ extern int32 BE_BPPToSDLPxFormat(int32 bpp); extern int BE_InitModes(_THIS); extern int BE_QuitModes(_THIS); extern int BE_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, - SDL_Rect *rect); + SDL_Rect *rect); extern void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display); extern int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, - SDL_DisplayMode *mode); + SDL_DisplayMode *mode); #ifdef __cplusplus } diff --git a/src/video/bwindow/SDL_bopengl.h b/src/video/bwindow/SDL_bopengl.h index 35a3b204c..f0279ba66 100644 --- a/src/video/bwindow/SDL_bopengl.h +++ b/src/video/bwindow/SDL_bopengl.h @@ -29,13 +29,13 @@ extern "C" { #include "../SDL_sysvideo.h" -extern int BE_GL_LoadLibrary(_THIS, const char *path); //FIXME -extern void *BE_GL_GetProcAddress(_THIS, const char *proc); //FIXME -extern void BE_GL_UnloadLibrary(_THIS); //TODO +extern int BE_GL_LoadLibrary(_THIS, const char *path); //FIXME +extern void *BE_GL_GetProcAddress(_THIS, const char *proc); //FIXME +extern void BE_GL_UnloadLibrary(_THIS); //TODO extern int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); -extern int BE_GL_SetSwapInterval(_THIS, int interval); //TODO -extern int BE_GL_GetSwapInterval(_THIS); //TODO +extern int BE_GL_SetSwapInterval(_THIS, int interval); //TODO +extern int BE_GL_GetSwapInterval(_THIS); //TODO extern void BE_GL_SwapWindow(_THIS, SDL_Window * window); extern SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window); extern void BE_GL_DeleteContext(_THIS, SDL_GLContext context); diff --git a/src/video/cocoa/SDL_cocoaclipboard.m b/src/video/cocoa/SDL_cocoaclipboard.m index fd499260a..ab31031b4 100644 --- a/src/video/cocoa/SDL_cocoaclipboard.m +++ b/src/video/cocoa/SDL_cocoaclipboard.m @@ -28,7 +28,6 @@ static NSString * GetTextFormat(_THIS) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; if (data->osversion >= 0x1060) { @@ -36,9 +35,6 @@ GetTextFormat(_THIS) } else { return NSStringPboardType; } -#else - return NSStringPboardType; -#endif } int @@ -99,8 +95,8 @@ Cocoa_HasClipboardText(_THIS) SDL_bool result = SDL_FALSE; char *text = Cocoa_GetClipboardText(_this); if (text) { - result = (SDL_strlen(text)>0) ? SDL_TRUE : SDL_FALSE; - SDL_free(text); + result = (SDL_strlen(text)>0) ? SDL_TRUE : SDL_FALSE; + SDL_free(text); } return result; } diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m index 7df95bbd0..f0a65e322 100644 --- a/src/video/cocoa/SDL_cocoaevents.m +++ b/src/video/cocoa/SDL_cocoaevents.m @@ -41,17 +41,70 @@ - (void)setAppleMenu:(NSMenu *)menu; @end -@interface SDLAppDelegate : NSObject +@interface SDLAppDelegate : NSObject { + BOOL seenFirstActivate; +} + +- (id)init; - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; +- (void)applicationDidBecomeActive:(NSNotification *)aNotification; @end @implementation SDLAppDelegate : NSObject +- (id)init +{ + self = [super init]; + + if (self) { + seenFirstActivate = NO; + } + + return self; +} + - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { SDL_SendQuit(); return NSTerminateCancel; } +- (void)applicationDidBecomeActive:(NSNotification *)aNotification +{ + /* HACK: Ignore the first call. The application gets a + * applicationDidBecomeActive: a little bit after the first window is + * created, and if we don't ignore it, a window that has been created with + * SDL_WINDOW_MINIZED will ~immediately be restored. + */ + if (!seenFirstActivate) { + seenFirstActivate = YES; + return; + } + + SDL_VideoDevice *device = SDL_GetVideoDevice(); + if (device && device->windows) + { + SDL_Window *window = device->windows; + int i; + for (i = 0; i < device->num_displays; ++i) + { + SDL_Window *fullscreen_window = device->displays[i].fullscreen_window; + if (fullscreen_window) + { + if (fullscreen_window->flags & SDL_WINDOW_MINIMIZED) { + SDL_RestoreWindow(fullscreen_window); + } + return; + } + } + + if (window->flags & SDL_WINDOW_MINIMIZED) { + SDL_RestoreWindow(window); + } else { + SDL_RaiseWindow(window); + } + } +} + - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { return (BOOL)SDL_SendDropFile([filename UTF8String]); @@ -68,7 +121,7 @@ GetApplicationName(void) dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); if (dict) appName = [dict objectForKey: @"CFBundleName"]; - + if (![appName length]) appName = [[NSProcessInfo processInfo] processName]; @@ -84,6 +137,10 @@ CreateApplicationMenus(void) NSMenu *serviceMenu; NSMenu *windowMenu; NSMenuItem *menuItem; + + if (NSApp == nil) { + return; + } /* Create the main menu bar */ [NSApp setMainMenu:[[NSMenu alloc] init]]; @@ -91,7 +148,7 @@ CreateApplicationMenus(void) /* Create the application menu */ appName = GetApplicationName(); appleMenu = [[NSMenu alloc] initWithTitle:@""]; - + /* Add menu items */ title = [@"About " stringByAppendingString:appName]; [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; @@ -123,7 +180,7 @@ CreateApplicationMenus(void) 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]; @@ -137,10 +194,10 @@ CreateApplicationMenus(void) /* Create the window menu */ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - + /* Add menu items */ [windowMenu addItemWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - + [windowMenu addItemWithTitle:@"Zoom" action:@selector(performZoom:) keyEquivalent:@""]; /* Put menu into the menubar */ @@ -148,7 +205,7 @@ CreateApplicationMenus(void) [menuItem setSubmenu:windowMenu]; [[NSApp mainMenu] addItem:menuItem]; [menuItem release]; - + /* Tell the application object that this is now the window menu */ [NSApp setWindowsMenu:windowMenu]; [windowMenu release]; @@ -175,7 +232,7 @@ Cocoa_RegisterApp(void) } [NSApp finishLaunching]; } - if ([NSApp delegate] == nil) { + if (NSApp && ![NSApp delegate]) { [NSApp setDelegate:[[SDLAppDelegate alloc] init]]; } [pool release]; @@ -203,7 +260,7 @@ Cocoa_PumpEvents(_THIS) if ( event == nil ) { break; } - + switch ([event type]) { case NSLeftMouseDown: case NSOtherMouseDown: diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 63f4bf942..8a6b87422 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -29,7 +29,7 @@ #include -//#define DEBUG_IME NSLog +/*#define DEBUG_IME NSLog */ #define DEBUG_IME(...) #ifndef NX_DEVICERCTLKEYMASK @@ -93,9 +93,10 @@ - (void) doCommandBySelector:(SEL) myselector { - // No need to do anything since we are not using Cocoa - // selectors to handle special keys, instead we use SDL - // key events to do the same job. + /* No need to do anything since we are not using Cocoa + selectors to handle special keys, instead we use SDL + key events to do the same job. + */ } - (BOOL) hasMarkedText @@ -171,28 +172,25 @@ return nil; } -/* Needs long instead of NSInteger for compilation on Mac OS X 10.4 */ -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 -- (long) conversationIdentifier -#else - (NSInteger) conversationIdentifier -#endif { - return (long) self; + return (NSInteger) self; } -// This method returns the index for character that is -// nearest to thePoint. thPoint is in screen coordinate system. +/* This method returns the index for character that is + * nearest to thePoint. thPoint is in screen coordinate system. + */ - (NSUInteger) characterIndexForPoint:(NSPoint) thePoint { DEBUG_IME(@"characterIndexForPoint: (%g, %g)", thePoint.x, thePoint.y); return 0; } -// This method is the key to attribute extension. -// We could add new attributes through this method. -// NSInputServer examines the return value of this -// method & constructs appropriate attributed string. +/* This method is the key to attribute extension. + * We could add new attributes through this method. + * NSInputServer examines the return value of this + * method & constructs appropriate attributed string. + */ - (NSArray *) validAttributesForMarkedText { return [NSArray array]; @@ -200,7 +198,7 @@ @end -/* This is the original behavior, before support was added for +/* This is the original behavior, before support was added for * differentiating between left and right versions of the keys. */ static void @@ -239,7 +237,7 @@ DoUnsidedModifiers(unsigned short scancode, } } -/* This is a helper function for HandleModifierSide. This +/* This is a helper function for HandleModifierSide. This * function reverts back to behavior before the distinction between * sides was made. */ @@ -250,13 +248,13 @@ HandleNonDeviceModifier(unsigned int device_independent_mask, SDL_Scancode scancode) { unsigned int oldMask, newMask; - - /* Isolate just the bits we care about in the depedent bits so we can + + /* Isolate just the bits we care about in the depedent bits so we can * figure out what changed - */ + */ oldMask = oldMods & device_independent_mask; newMask = newMods & device_independent_mask; - + if (oldMask && oldMask != newMask) { SDL_SendKeyboardKey(SDL_RELEASED, scancode); } else if (newMask && oldMask != newMask) { @@ -264,24 +262,24 @@ HandleNonDeviceModifier(unsigned int device_independent_mask, } } -/* This is a helper function for HandleModifierSide. +/* This is a helper function for HandleModifierSide. * This function sets the actual SDL_PrivateKeyboard event. */ static void HandleModifierOneSide(unsigned int oldMods, unsigned int newMods, - SDL_Scancode scancode, + SDL_Scancode scancode, unsigned int sided_device_dependent_mask) { unsigned int old_dep_mask, new_dep_mask; - /* Isolate just the bits we care about in the depedent bits so we can + /* Isolate just the bits we care about in the depedent bits so we can * figure out what changed - */ + */ old_dep_mask = oldMods & sided_device_dependent_mask; new_dep_mask = newMods & sided_device_dependent_mask; /* We now know that this side bit flipped. But we don't know if - * it went pressed to released or released to pressed, so we must + * it went pressed to released or released to pressed, so we must * find out which it is. */ if (new_dep_mask && old_dep_mask != new_dep_mask) { @@ -292,23 +290,23 @@ HandleModifierOneSide(unsigned int oldMods, unsigned int newMods, } /* This is a helper function for DoSidedModifiers. - * This function will figure out if the modifier key is the left or right side, - * e.g. left-shift vs right-shift. + * This function will figure out if the modifier key is the left or right side, + * e.g. left-shift vs right-shift. */ static void -HandleModifierSide(int device_independent_mask, - unsigned int oldMods, unsigned int newMods, - SDL_Scancode left_scancode, +HandleModifierSide(int device_independent_mask, + unsigned int oldMods, unsigned int newMods, + SDL_Scancode left_scancode, SDL_Scancode right_scancode, - unsigned int left_device_dependent_mask, + unsigned int left_device_dependent_mask, unsigned int right_device_dependent_mask) { unsigned int device_dependent_mask = (left_device_dependent_mask | right_device_dependent_mask); unsigned int diff_mod; - - /* On the basis that the device independent mask is set, but there are - * no device dependent flags set, we'll assume that we can't detect this + + /* On the basis that the device independent mask is set, but there are + * no device dependent flags set, we'll assume that we can't detect this * keyboard and revert to the unsided behavior. */ if ((device_dependent_mask & newMods) == 0) { @@ -321,7 +319,7 @@ HandleModifierSide(int device_independent_mask, diff_mod = (device_dependent_mask & oldMods) ^ (device_dependent_mask & newMods); if (diff_mod) { - /* A change in state was found. Isolate the left and right bits + /* A change in state was found. Isolate the left and right bits * to handle them separately just in case the values can simulataneously * change or if the bits don't both exist. */ @@ -333,38 +331,38 @@ HandleModifierSide(int device_independent_mask, } } } - + /* This is a helper function for DoSidedModifiers. - * This function will release a key press in the case that - * it is clear that the modifier has been released (i.e. one side + * This function will release a key press in the case that + * it is clear that the modifier has been released (i.e. one side * can't still be down). */ static void -ReleaseModifierSide(unsigned int device_independent_mask, +ReleaseModifierSide(unsigned int device_independent_mask, unsigned int oldMods, unsigned int newMods, - SDL_Scancode left_scancode, + SDL_Scancode left_scancode, SDL_Scancode right_scancode, - unsigned int left_device_dependent_mask, + unsigned int left_device_dependent_mask, unsigned int right_device_dependent_mask) { unsigned int device_dependent_mask = (left_device_dependent_mask | right_device_dependent_mask); - /* On the basis that the device independent mask is set, but there are - * no device dependent flags set, we'll assume that we can't detect this + /* On the basis that the device independent mask is set, but there are + * no device dependent flags set, we'll assume that we can't detect this * keyboard and revert to the unsided behavior. */ if ((device_dependent_mask & oldMods) == 0) { - /* In this case, we can't detect the keyboard, so use the left side - * to represent both, and release it. + /* In this case, we can't detect the keyboard, so use the left side + * to represent both, and release it. */ SDL_SendKeyboardKey(SDL_RELEASED, left_scancode); return; } - /* + /* * This could have been done in an if-else case because at this point, - * we know that all keys have been released when calling this function. + * we know that all keys have been released when calling this function. * But I'm being paranoid so I want to handle each separately, * so I hope this doesn't cause other problems. */ @@ -384,7 +382,7 @@ HandleCapsLock(unsigned short scancode, unsigned int oldMods, unsigned int newMods) { unsigned int oldMask, newMask; - + oldMask = oldMods & NSAlphaShiftKeyMask; newMask = newMods & NSAlphaShiftKeyMask; @@ -392,24 +390,16 @@ HandleCapsLock(unsigned short scancode, SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK); SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK); } - - oldMask = oldMods & NSNumericPadKeyMask; - newMask = newMods & NSNumericPadKeyMask; - - if (oldMask != newMask) { - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR); - } } -/* This function will handle the modifier keys and also determine the +/* This function will handle the modifier keys and also determine the * correct side of the key. */ static void DoSidedModifiers(unsigned short scancode, unsigned int oldMods, unsigned int newMods) { - /* Set up arrays for the key syms for the left and right side. */ + /* Set up arrays for the key syms for the left and right side. */ const SDL_Scancode left_mapping[] = { SDL_SCANCODE_LSHIFT, SDL_SCANCODE_LCTRL, @@ -422,8 +412,8 @@ DoSidedModifiers(unsigned short scancode, SDL_SCANCODE_RALT, SDL_SCANCODE_RGUI }; - /* Set up arrays for the device dependent masks with indices that - * correspond to the _mapping arrays + /* Set up arrays for the device dependent masks with indices that + * correspond to the _mapping arrays */ const unsigned int left_device_mapping[] = { NX_DEVICELSHIFTKEYMASK, NX_DEVICELCTLKEYMASK, NX_DEVICELALTKEYMASK, NX_DEVICELCMDKEYMASK }; const unsigned int right_device_mapping[] = { NX_DEVICERSHIFTKEYMASK, NX_DEVICERCTLKEYMASK, NX_DEVICERALTKEYMASK, NX_DEVICERCMDKEYMASK }; @@ -436,10 +426,10 @@ DoSidedModifiers(unsigned short scancode, /* Iterate through the bits, testing each against the old modifiers */ for (i = 0, bit = NSShiftKeyMask; bit <= NSCommandKeyMask; bit <<= 1, ++i) { unsigned int oldMask, newMask; - + oldMask = oldMods & bit; newMask = newMods & bit; - + /* If the bit is set, we must always examine it because the left * and right side keys may alternate or both may be pressed. */ @@ -465,11 +455,11 @@ HandleModifiers(_THIS, unsigned short scancode, unsigned int modifierFlags) SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; if (modifierFlags == data->modifierFlags) { - return; + return; } - /* - * Starting with Panther (10.3.0), the ability to distinguish between + /* + * Starting with Panther (10.3.0), the ability to distinguish between * left side and right side modifiers is available. */ if (data->osversion >= 0x1030) { @@ -483,22 +473,14 @@ HandleModifiers(_THIS, unsigned short scancode, unsigned int modifierFlags) static void UpdateKeymap(SDL_VideoData *data) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 TISInputSourceRef key_layout; -#else - KeyboardLayoutRef key_layout; -#endif const void *chr_data; int i; SDL_Scancode scancode; SDL_Keycode keymap[SDL_NUM_SCANCODES]; /* See if the keymap needs to be updated */ -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 key_layout = TISCopyCurrentKeyboardLayoutInputSource(); -#else - KLGetCurrentKeyboardLayout(&key_layout); -#endif if (key_layout == data->key_layout) { return; } @@ -506,16 +488,13 @@ UpdateKeymap(SDL_VideoData *data) SDL_GetDefaultKeymap(keymap); - /* Try Unicode data first (preferred as of Mac OS X 10.5) */ -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 + /* Try Unicode data first */ CFDataRef uchrDataRef = TISGetInputSourceProperty(key_layout, kTISPropertyUnicodeKeyLayoutData); if (uchrDataRef) chr_data = CFDataGetBytePtr(uchrDataRef); else goto cleanup; -#else - KLGetKeyboardLayoutProperty(key_layout, kKLuchrData, &chr_data); -#endif + if (chr_data) { UInt32 keyboard_type = LMGetKbdType(); OSStatus err; @@ -549,60 +528,8 @@ UpdateKeymap(SDL_VideoData *data) return; } -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 cleanup: CFRelease(key_layout); -#else - /* Fall back to older style key map data */ - KLGetKeyboardLayoutProperty(key_layout, kKLKCHRData, &chr_data); - if (chr_data) { - for (i = 0; i < 128; i++) { - UInt32 c, state = 0; - - /* Make sure this scancode is a valid character scancode */ - scancode = darwin_scancode_table[i]; - if (scancode == SDL_SCANCODE_UNKNOWN || - (keymap[scancode] & SDLK_SCANCODE_MASK)) { - continue; - } - - c = KeyTranslate (chr_data, i, &state) & 255; - if (state) { - /* Dead key, process key up */ - c = KeyTranslate (chr_data, i | 128, &state) & 255; - } - - if (c != 0 && c != 0x10) { - /* MacRoman to Unicode table, taken from X.org sources */ - static const unsigned short macroman_table[128] = { - 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1, - 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8, - 0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3, - 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc, - 0x2020, 0xb0, 0xa2, 0xa3, 0xa7, 0x2022, 0xb6, 0xdf, - 0xae, 0xa9, 0x2122, 0xb4, 0xa8, 0x2260, 0xc6, 0xd8, - 0x221e, 0xb1, 0x2264, 0x2265, 0xa5, 0xb5, 0x2202, 0x2211, - 0x220f, 0x3c0, 0x222b, 0xaa, 0xba, 0x3a9, 0xe6, 0xf8, - 0xbf, 0xa1, 0xac, 0x221a, 0x192, 0x2248, 0x2206, 0xab, - 0xbb, 0x2026, 0xa0, 0xc0, 0xc3, 0xd5, 0x152, 0x153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0xf7, 0x25ca, - 0xff, 0x178, 0x2044, 0x20ac, 0x2039, 0x203a, 0xfb01, 0xfb02, - 0x2021, 0xb7, 0x201a, 0x201e, 0x2030, 0xc2, 0xca, 0xc1, - 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4, - 0xf8ff, 0xd2, 0xda, 0xdb, 0xd9, 0x131, 0x2c6, 0x2dc, - 0xaf, 0x2d8, 0x2d9, 0x2da, 0xb8, 0x2dd, 0x2db, 0x2c7, - }; - - if (c >= 128) { - c = macroman_table[c - 128]; - } - keymap[scancode] = c; - } - } - SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); - return; - } -#endif } void @@ -611,7 +538,7 @@ Cocoa_InitKeyboard(_THIS) SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; UpdateKeymap(data); - + /* Set our own names for the platform-dependent but layout-independent keys */ /* This key is NumLock on the MacBook keyboard. :) */ /*SDL_SetScancodeName(SDL_SCANCODE_NUMLOCKCLEAR, "Clear");*/ @@ -640,7 +567,7 @@ Cocoa_StartTextInput(_THIS) if (![[data->fieldEdit superview] isEqual: parentView]) { - // DEBUG_IME(@"add fieldEdit to window contentView"); + /* DEBUG_IME(@"add fieldEdit to window contentView"); */ [data->fieldEdit removeFromSuperview]; [parentView addSubview: data->fieldEdit]; [[NSApp keyWindow] makeFirstResponder: data->fieldEdit]; @@ -669,8 +596,8 @@ Cocoa_SetTextInputRect(_THIS, SDL_Rect *rect) SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; if (!rect) { - SDL_InvalidParamError("rect"); - return; + SDL_InvalidParamError("rect"); + return; } [data->fieldEdit setInputRect: rect]; diff --git a/src/video/cocoa/SDL_cocoamessagebox.m b/src/video/cocoa/SDL_cocoamessagebox.m index c7b72361b..78b80ae69 100644 --- a/src/video/cocoa/SDL_cocoamessagebox.m +++ b/src/video/cocoa/SDL_cocoamessagebox.m @@ -22,16 +22,66 @@ #if SDL_VIDEO_DRIVER_COCOA -#if defined(__APPLE__) && defined(__POWERPC__) +#if defined(__APPLE__) && defined(__POWERPC__) && !defined(__APPLE_ALTIVEC__) #include #undef bool #undef vector #undef pixel #endif +#include "SDL_events.h" +#include "SDL_timer.h" #include "SDL_messagebox.h" #include "SDL_cocoavideo.h" +@interface SDLMessageBoxPresenter : NSObject { +@public + NSInteger clicked; + NSWindow *nswindow; +} +- (id) initWithParentWindow:(SDL_Window *)window; +- (void) alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; +@end + +@implementation SDLMessageBoxPresenter +- (id) initWithParentWindow:(SDL_Window *)window +{ + self = [super init]; + if (self) { + clicked = -1; + + /* Retain the NSWindow because we'll show the alert later on the main thread */ + if (window) { + nswindow = [((SDL_WindowData *) window->driverdata)->nswindow retain]; + } else { + nswindow = NULL; + } + } + + return self; +} + +- (void)showAlert:(NSAlert*)alert +{ + if (nswindow) { + [alert beginSheetModalForWindow:nswindow modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil]; + while (clicked < 0) { + SDL_PumpEvents(); + SDL_Delay(100); + } + [nswindow release]; + } else { + clicked = [alert runModal]; + } +} + +- (void) alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo +{ + clicked = returnCode; +} + +@end + /* Display a Cocoa message box */ int @@ -41,7 +91,7 @@ Cocoa_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSAlert* alert = [[NSAlert alloc] init]; + NSAlert* alert = [[[NSAlert alloc] init] autorelease]; if (messageboxdata->flags & SDL_MESSAGEBOX_ERROR) { [alert setAlertStyle:NSCriticalAlertStyle]; @@ -67,14 +117,27 @@ Cocoa_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) } } - NSInteger clicked = [alert runModal]; - clicked -= NSAlertFirstButtonReturn; - *buttonid = buttons[clicked].buttonid; - [alert release]; + SDLMessageBoxPresenter* presenter = [[[SDLMessageBoxPresenter alloc] initWithParentWindow:messageboxdata->window] autorelease]; + + [presenter performSelectorOnMainThread:@selector(showAlert:) + withObject:alert + waitUntilDone:YES]; + + int returnValue = 0; + NSInteger clicked = presenter->clicked; + if (clicked >= NSAlertFirstButtonReturn) + { + clicked -= NSAlertFirstButtonReturn; + *buttonid = buttons[clicked].buttonid; + } + else + { + returnValue = SDL_SetError("Did not get a valid `clicked button' id: %d", clicked); + } [pool release]; - return 0; + return returnValue; } #endif /* SDL_VIDEO_DRIVER_COCOA */ diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m index 563226c2a..f10e7ee20 100644 --- a/src/video/cocoa/SDL_cocoamodes.m +++ b/src/video/cocoa/SDL_cocoamodes.m @@ -30,6 +30,9 @@ /* we need this for ShowMenuBar() and HideMenuBar(). */ #include +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include + static inline void Cocoa_ToggleMenuBar(const BOOL show) { /* !!! FIXME: keep an eye on this. @@ -47,33 +50,13 @@ static inline void Cocoa_ToggleMenuBar(const BOOL show) /* !!! FIXME: clean out the pre-10.6 code when it makes sense to do so. */ -#define FORCE_OLD_API 0 || (MAC_OS_X_VERSION_MAX_ALLOWED < 1060) +#define FORCE_OLD_API 0 #if FORCE_OLD_API #undef MAC_OS_X_VERSION_MIN_REQUIRED #define MAC_OS_X_VERSION_MIN_REQUIRED 1050 #endif -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 -/* - Add methods to get at private members of NSScreen. - Since there is a bug in Apple's screen switching code - that does not update this variable when switching - to fullscreen, we'll set it manually (but only for the - main screen). -*/ -@interface NSScreen (NSScreenAccess) -- (void) setFrame:(NSRect)frame; -@end - -@implementation NSScreen (NSScreenAccess) -- (void) setFrame:(NSRect)frame; -{ - _frame = frame; -} -@end -#endif - static inline BOOL IS_SNOW_LEOPARD_OR_LATER(_THIS) { @@ -142,7 +125,6 @@ GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode) } data->moderef = moderef; - #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { CGDisplayModeRef vidmode = (CGDisplayModeRef) moderef; CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode); @@ -162,7 +144,6 @@ GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode) CFRelease(fmt); } - #endif #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 if (!IS_SNOW_LEOPARD_OR_LATER(_this)) { @@ -201,23 +182,17 @@ GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode) static inline void Cocoa_ReleaseDisplayMode(_THIS, const void *moderef) { - /* We don't own moderef unless we use the 10.6+ APIs. */ - #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { CGDisplayModeRelease((CGDisplayModeRef) moderef); /* NULL is ok */ } - #endif } static inline void Cocoa_ReleaseDisplayModeList(_THIS, CFArrayRef modelist) { - /* We don't own modelis unless we use the 10.6+ APIs. */ - #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { CFRelease(modelist); /* NULL is ok */ } - #endif } static const char * @@ -226,7 +201,7 @@ Cocoa_GetDisplayName(CGDirectDisplayID displayID) NSDictionary *deviceInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), kIODisplayOnlyPreferredName); NSDictionary *localizedNames = [deviceInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]]; const char* displayName = NULL; - + if ([localizedNames count] > 0) { displayName = SDL_strdup([[localizedNames objectForKey:[[localizedNames allKeys] objectAtIndex:0]] UTF8String]); } @@ -280,11 +255,9 @@ Cocoa_InitModes(_THIS) continue; } - #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { moderef = CGDisplayCopyDisplayMode(displays[i]); } - #endif #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 if (!IS_SNOW_LEOPARD_OR_LATER(_this)) { @@ -304,7 +277,7 @@ Cocoa_InitModes(_THIS) displaydata->display = displays[i]; SDL_zero(display); - // this returns a stddup'ed string + /* this returns a stddup'ed string */ display.name = (char *)Cocoa_GetDisplayName(displays[i]); if (!GetDisplayMode (_this, moderef, &mode)) { Cocoa_ReleaseDisplayMode(_this, moderef); @@ -344,11 +317,9 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display) SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; CFArrayRef modes = NULL; - #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { modes = CGDisplayCopyAllDisplayModes(data->display, NULL); } - #endif #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 if (!IS_SNOW_LEOPARD_OR_LATER(_this)) { @@ -364,11 +335,9 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display) const void *moderef = CFArrayGetValueAtIndex(modes, i); SDL_DisplayMode mode; if (GetDisplayMode(_this, moderef, &mode)) { - #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { CGDisplayModeRetain((CGDisplayModeRef) moderef); } - #endif SDL_AddDisplayMode(display, &mode); } } @@ -380,12 +349,10 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display) static CGError Cocoa_SwitchMode(_THIS, CGDirectDisplayID display, const void *mode) { - #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { return CGDisplaySetDisplayMode(display, (CGDisplayModeRef) mode, NULL); } - #endif - + #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 if (!IS_SNOW_LEOPARD_OR_LATER(_this)) { return CGDisplaySwitchToMode(display, (CFDictionaryRef) mode); diff --git a/src/video/cocoa/SDL_cocoamouse.h b/src/video/cocoa/SDL_cocoamouse.h index 992af549f..eb6f5891f 100644 --- a/src/video/cocoa/SDL_cocoamouse.h +++ b/src/video/cocoa/SDL_cocoamouse.h @@ -23,11 +23,23 @@ #ifndef _SDL_cocoamouse_h #define _SDL_cocoamouse_h +#include "SDL_cocoavideo.h" + extern void Cocoa_InitMouse(_THIS); extern void Cocoa_HandleMouseEvent(_THIS, NSEvent * event); extern void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent * event); extern void Cocoa_QuitMouse(_THIS); +typedef struct { + int deltaXOffset; + int deltaYOffset; + void *tapdata; +} SDL_MouseData; + +@interface NSCursor (InvisibleCursor) ++ (NSCursor *)invisibleCursor; +@end + #endif /* _SDL_cocoamouse_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m index a12bde8dd..faba9618e 100644 --- a/src/video/cocoa/SDL_cocoamouse.m +++ b/src/video/cocoa/SDL_cocoamouse.m @@ -24,10 +24,37 @@ #include "SDL_assert.h" #include "SDL_events.h" -#include "SDL_cocoavideo.h" +#include "SDL_cocoamouse.h" +#include "SDL_cocoamousetap.h" #include "../../events/SDL_mouse_c.h" +@implementation NSCursor (InvisibleCursor) ++ (NSCursor *)invisibleCursor +{ + static NSCursor *invisibleCursor = NULL; + if (!invisibleCursor) { + /* RAW 16x16 transparent GIF */ + static unsigned char cursorBytes[] = { + 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0xF9, 0x04, + 0x01, 0x00, 0x00, 0x01, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x10, 0x00, 0x00, 0x02, 0x0E, 0x8C, 0x8F, 0xA9, 0xCB, 0xED, + 0x0F, 0xA3, 0x9C, 0xB4, 0xDA, 0x8B, 0xB3, 0x3E, 0x05, 0x00, 0x3B + }; + + NSData *cursorData = [NSData dataWithBytesNoCopy:&cursorBytes[0] + length:sizeof(cursorBytes) + freeWhenDone:NO]; + NSImage *cursorImage = [[[NSImage alloc] initWithData:cursorData] autorelease]; + invisibleCursor = [[NSCursor alloc] initWithImage:cursorImage + hotSpot:NSZeroPoint]; + } + + return invisibleCursor; +} +@end + static SDL_Cursor * Cocoa_CreateDefaultCursor() @@ -68,6 +95,8 @@ Cocoa_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { cursor->driverdata = nscursor; + } else { + [nscursor release]; } } @@ -127,7 +156,7 @@ Cocoa_CreateSystemCursor(SDL_SystemCursor id) if (nscursor) { cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { - // We'll free it later, so retain it here + /* We'll free it later, so retain it here */ [nscursor retain]; cursor->driverdata = nscursor; } @@ -155,13 +184,15 @@ Cocoa_ShowCursor(SDL_Cursor * cursor) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - if (cursor) { - NSCursor *nscursor = (NSCursor *)cursor->driverdata; - - [nscursor set]; - [NSCursor unhide]; - } else { - [NSCursor hide]; + SDL_VideoDevice *device = SDL_GetVideoDevice(); + SDL_Window *window = (device ? device->windows : NULL); + for (; window != NULL; window = window->next) { + SDL_WindowData *driverdata = (SDL_WindowData *)window->driverdata; + if (driverdata) { + [driverdata->nswindow performSelectorOnMainThread:@selector(invalidateCursorRectsForView:) + withObject:[driverdata->nswindow contentView] + waitUntilDone:NO]; + } } [pool release]; @@ -172,11 +203,39 @@ Cocoa_ShowCursor(SDL_Cursor * cursor) static void Cocoa_WarpMouse(SDL_Window * window, int x, int y) { - CGPoint point; + SDL_Mouse *mouse = SDL_GetMouse(); + CGPoint point = CGPointMake(x, y); - point.x = (float)window->x + x; - point.y = (float)window->y + y; + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) + { + point.x += window->x; + point.y += window->y; + } + + { + /* This makes Cocoa_HandleMouseEvent ignore this delta in the next + * movement event. + */ + SDL_MouseData *driverdata = (SDL_MouseData*)mouse->driverdata; + NSPoint location = [NSEvent mouseLocation]; + driverdata->deltaXOffset = location.x - point.x; + driverdata->deltaYOffset = point.y - location.y; + } + + /* According to the docs, this was deprecated in 10.6, but it's still + * around. The substitute requires a CGEventSource, but I'm not entirely + * sure how we'd procure the right one for this event. + */ + CGSetLocalEventsSuppressionInterval(0.0); CGWarpMouseCursorPosition(point); + CGSetLocalEventsSuppressionInterval(0.25); + + if (!mouse->relative_mode) { + /* CGWarpMouseCursorPosition doesn't generate a window event, unlike our + * other implementations' APIs. + */ + SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 0, x, y); + } } static int @@ -200,6 +259,8 @@ Cocoa_InitMouse(_THIS) { SDL_Mouse *mouse = SDL_GetMouse(); + mouse->driverdata = SDL_calloc(1, sizeof(SDL_MouseData)); + mouse->CreateCursor = Cocoa_CreateCursor; mouse->CreateSystemCursor = Cocoa_CreateSystemCursor; mouse->ShowCursor = Cocoa_ShowCursor; @@ -208,6 +269,8 @@ Cocoa_InitMouse(_THIS) mouse->SetRelativeMouseMode = Cocoa_SetRelativeMouseMode; SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor()); + + Cocoa_InitMouseEventTap(mouse->driverdata); } void @@ -220,8 +283,11 @@ Cocoa_HandleMouseEvent(_THIS, NSEvent *event) [event type] == NSLeftMouseDragged || [event type] == NSRightMouseDragged || [event type] == NSOtherMouseDragged)) { - float x = [event deltaX]; - float y = [event deltaY]; + SDL_MouseData *driverdata = (SDL_MouseData*)mouse->driverdata; + float x = [event deltaX] + driverdata->deltaXOffset; + float y = [event deltaY] + driverdata->deltaYOffset; + driverdata->deltaXOffset = driverdata->deltaYOffset = 0; + SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 1, (int)x, (int)y); } } @@ -250,6 +316,14 @@ Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event) void Cocoa_QuitMouse(_THIS) { + SDL_Mouse *mouse = SDL_GetMouse(); + if (mouse) { + if (mouse->driverdata) { + Cocoa_QuitMouseEventTap(((SDL_MouseData*)mouse->driverdata)); + } + + SDL_free(mouse->driverdata); + } } #endif /* SDL_VIDEO_DRIVER_COCOA */ diff --git a/test/test-automation/src/runner/support.h b/src/video/cocoa/SDL_cocoamousetap.h similarity index 68% rename from test/test-automation/src/runner/support.h rename to src/video/cocoa/SDL_cocoamousetap.h index 03a0faf9f..a13d97bb5 100644 --- a/test/test-automation/src/runner/support.h +++ b/src/video/cocoa/SDL_cocoamousetap.h @@ -1,5 +1,6 @@ /* - Copyright (C) 2011 Markus Kauppila + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -17,23 +18,16 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ +#include "SDL_config.h" -#ifndef _SUPPORT_H -#define _SUPPORT_H +#ifndef _SDL_cocoamousetap_h +#define _SDL_cocoamousetap_h -/*! - * Checks if platform supports audio. - * - * \return 1 if audio is supported, otherwise 0 - */ -int PlatformSupportsAudio(); +#include "SDL_cocoamouse.h" -/*! - * Checks if platform supports stdio. - * - * \return 1 if audio is supported, otherwise 0 - */ -int PlatformSupportsStdio(); +extern void Cocoa_InitMouseEventTap(SDL_MouseData *driverdata); +extern void Cocoa_QuitMouseEventTap(SDL_MouseData *driverdata); +#endif /* _SDL_cocoamousetap_h */ -#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/cocoa/SDL_cocoamousetap.m b/src/video/cocoa/SDL_cocoamousetap.m new file mode 100644 index 000000000..5879d49bf --- /dev/null +++ b/src/video/cocoa/SDL_cocoamousetap.m @@ -0,0 +1,257 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as 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_COCOA + +#include "SDL_cocoamousetap.h" + +/* Event taps are forbidden in the Mac App Store, so we can only enable this + * code if your app doesn't need to ship through the app store. + * This code makes it so that a grabbed cursor cannot "leak" a mouse click + * past the edge of the window if moving the cursor too fast. + */ +#if SDL_MAC_NO_SANDBOX + +#include "SDL_keyboard.h" +#include "SDL_thread.h" +#include "SDL_cocoavideo.h" + +#include "../../events/SDL_mouse_c.h" + +typedef struct { + CFMachPortRef tap; + CFRunLoopRef runloop; + CFRunLoopSourceRef runloopSource; + SDL_Thread *thread; + SDL_sem *runloopStartedSemaphore; +} SDL_MouseEventTapData; + +static const CGEventMask movementEventsMask = + CGEventMaskBit(kCGEventLeftMouseDragged) + | CGEventMaskBit(kCGEventRightMouseDragged) + | CGEventMaskBit(kCGEventMouseMoved); + +static const CGEventMask allGrabbedEventsMask = + CGEventMaskBit(kCGEventLeftMouseDown) | CGEventMaskBit(kCGEventLeftMouseUp) + | CGEventMaskBit(kCGEventRightMouseDown) | CGEventMaskBit(kCGEventRightMouseUp) + | CGEventMaskBit(kCGEventOtherMouseDown) | CGEventMaskBit(kCGEventOtherMouseUp) + | CGEventMaskBit(kCGEventLeftMouseDragged) | CGEventMaskBit(kCGEventRightMouseDragged) + | CGEventMaskBit(kCGEventMouseMoved); + +static CGEventRef +Cocoa_MouseTapCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon) +{ + SDL_MouseData *driverdata = (SDL_MouseData*)refcon; + SDL_Mouse *mouse = SDL_GetMouse(); + SDL_Window *window = SDL_GetKeyboardFocus(); + NSRect windowRect; + CGPoint eventLocation; + + switch (type) + { + case kCGEventTapDisabledByTimeout: + case kCGEventTapDisabledByUserInput: + { + CGEventTapEnable(((SDL_MouseEventTapData*)(driverdata->tapdata))->tap, true); + return NULL; + } + default: + break; + } + + + if (!window || !mouse) { + return event; + } + + if (mouse->relative_mode) { + return event; + } + + if (!(window->flags & SDL_WINDOW_INPUT_GRABBED)) { + return event; + } + + /* This is the same coordinate system as Cocoa uses. */ + eventLocation = CGEventGetUnflippedLocation(event); + windowRect = [((SDL_WindowData *) window->driverdata)->nswindow frame]; + + if (!NSPointInRect(NSPointFromCGPoint(eventLocation), windowRect)) { + + /* This is in CGs global screenspace coordinate system, which has a + * flipped Y. + */ + CGPoint newLocation = CGEventGetLocation(event); + + if (eventLocation.x < NSMinX(windowRect)) { + newLocation.x = NSMinX(windowRect); + } else if (eventLocation.x >= NSMaxX(windowRect)) { + newLocation.x = NSMaxX(windowRect) - 1.0; + } + + if (eventLocation.y < NSMinY(windowRect)) { + newLocation.y -= (NSMinY(windowRect) - eventLocation.y + 1); + } else if (eventLocation.y >= NSMaxY(windowRect)) { + newLocation.y += (eventLocation.y - NSMaxY(windowRect) + 1); + } + + CGSetLocalEventsSuppressionInterval(0); + CGWarpMouseCursorPosition(newLocation); + CGSetLocalEventsSuppressionInterval(0.25); + + if ((CGEventMaskBit(type) & movementEventsMask) == 0) { + /* For click events, we just constrain the event to the window, so + * no other app receives the click event. We can't due the same to + * movement events, since they mean that our warp cursor above + * behaves strangely. + */ + CGEventSetLocation(event, newLocation); + } + } + + return event; +} + +static void +SemaphorePostCallback(CFRunLoopTimerRef timer, void *info) +{ + SDL_SemPost((SDL_sem*)info); +} + +static int +Cocoa_MouseTapThread(void *data) +{ + SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)data; + + /* Create a tap. */ + CFMachPortRef eventTap = CGEventTapCreate(kCGSessionEventTap, kCGHeadInsertEventTap, + kCGEventTapOptionDefault, allGrabbedEventsMask, + &Cocoa_MouseTapCallback, tapdata); + if (eventTap) { + /* Try to create a runloop source we can schedule. */ + CFRunLoopSourceRef runloopSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventTap, 0); + if (runloopSource) { + tapdata->tap = eventTap; + tapdata->runloopSource = runloopSource; + } else { + CFRelease(eventTap); + SDL_SemPost(tapdata->runloopStartedSemaphore); + /* TODO: Both here and in the return below, set some state in + * tapdata to indicate that initialization failed, which we should + * check in InitMouseEventTap, after we move the semaphore check + * from Quit to Init. + */ + return 1; + } + } else { + SDL_SemPost(tapdata->runloopStartedSemaphore); + return 1; + } + + tapdata->runloop = CFRunLoopGetCurrent(); + CFRunLoopAddSource(tapdata->runloop, tapdata->runloopSource, kCFRunLoopCommonModes); + CFRunLoopTimerContext context = {.info = tapdata->runloopStartedSemaphore}; + /* We signal the runloop started semaphore *after* the run loop has started, indicating it's safe to CFRunLoopStop it. */ + CFRunLoopTimerRef timer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 0, 0, 0, &SemaphorePostCallback, &context); + CFRunLoopAddTimer(tapdata->runloop, timer, kCFRunLoopCommonModes); + CFRelease(timer); + + /* Run the event loop to handle events in the event tap. */ + CFRunLoopRun(); + /* Make sure this is signaled so that SDL_QuitMouseEventTap knows it can safely SDL_WaitThread for us. */ + if (SDL_SemValue(tapdata->runloopStartedSemaphore) < 1) { + SDL_SemPost(tapdata->runloopStartedSemaphore); + } + CFRunLoopRemoveSource(tapdata->runloop, tapdata->runloopSource, kCFRunLoopCommonModes); + + /* Clean up. */ + CGEventTapEnable(tapdata->tap, false); + CFRelease(tapdata->runloopSource); + CFRelease(tapdata->tap); + tapdata->runloopSource = NULL; + tapdata->tap = NULL; + + return 0; +} + +void +Cocoa_InitMouseEventTap(SDL_MouseData* driverdata) +{ + SDL_MouseEventTapData *tapdata; + driverdata->tapdata = SDL_calloc(1, sizeof(SDL_MouseEventTapData)); + tapdata = (SDL_MouseEventTapData*)driverdata->tapdata; + + tapdata->runloopStartedSemaphore = SDL_CreateSemaphore(0); + if (tapdata->runloopStartedSemaphore) { + tapdata->thread = SDL_CreateThread(&Cocoa_MouseTapThread, "Event Tap Loop", tapdata); + if (!tapdata->thread) { + SDL_DestroySemaphore(tapdata->runloopStartedSemaphore); + } + } + + if (!tapdata->thread) { + SDL_free(driverdata->tapdata); + driverdata->tapdata = NULL; + } +} + +void +Cocoa_QuitMouseEventTap(SDL_MouseData *driverdata) +{ + SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)driverdata->tapdata; + int status; + + /* Ensure that the runloop has been started first. + * TODO: Move this to InitMouseEventTap, check for error conditions that can + * happen in Cocoa_MouseTapThread, and fall back to the non-EventTap way of + * grabbing the mouse if it fails to Init. + */ + status = SDL_SemWaitTimeout(tapdata->runloopStartedSemaphore, 5000); + if (status > -1) { + /* Then stop it, which will cause Cocoa_MouseTapThread to return. */ + CFRunLoopStop(tapdata->runloop); + /* And then wait for Cocoa_MouseTapThread to finish cleaning up. It + * releases some of the pointers in tapdata. */ + SDL_WaitThread(tapdata->thread, &status); + } + + SDL_free(driverdata->tapdata); + driverdata->tapdata = NULL; +} + +#else /* SDL_MAC_NO_SANDBOX */ + +void +Cocoa_InitMouseEventTap(SDL_MouseData *unused) +{ +} + +void +Cocoa_QuitMouseEventTap(SDL_MouseData *driverdata) +{ +} + +#endif /* !SDL_MAC_NO_SANDBOX */ + +#endif /* SDL_VIDEO_DRIVER_COCOA */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/cocoa/SDL_cocoaopengl.h b/src/video/cocoa/SDL_cocoaopengl.h index 4c4005be7..2d06700b6 100644 --- a/src/video/cocoa/SDL_cocoaopengl.h +++ b/src/video/cocoa/SDL_cocoaopengl.h @@ -25,14 +25,28 @@ #if SDL_VIDEO_OPENGL_CGL -/* Define this if you want to be able to toggle fullscreen mode seamlessly */ -#define FULLSCREEN_TOGGLEABLE +#include "SDL_atomic.h" +#import struct SDL_GLDriverData { int initialized; }; +@interface SDLOpenGLContext : NSOpenGLContext { + SDL_atomic_t dirty; + SDL_Window *window; +} + +- (id)initWithFormat:(NSOpenGLPixelFormat *)format + shareContext:(NSOpenGLContext *)share; +- (void)scheduleUpdate; +- (void)updateIfNeeded; +- (void)setWindow:(SDL_Window *)window; + +@end + + /* OpenGL functions */ extern int Cocoa_GL_LoadLibrary(_THIS, const char *path); extern void *Cocoa_GL_GetProcAddress(_THIS, const char *proc); diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index a1686219b..0d49ba0cc 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -24,6 +24,7 @@ #if SDL_VIDEO_OPENGL_CGL #include "SDL_cocoavideo.h" +#include "SDL_cocoaopengl.h" #include #include @@ -45,6 +46,78 @@ #define kCGLOGLPVersion_3_2_Core 0x3200 #endif +@implementation SDLOpenGLContext : NSOpenGLContext + +- (id)initWithFormat:(NSOpenGLPixelFormat *)format + shareContext:(NSOpenGLContext *)share +{ + self = [super initWithFormat:format shareContext:share]; + if (self) { + SDL_AtomicSet(&self->dirty, 0); + self->window = NULL; + } + return self; +} + +- (void)scheduleUpdate +{ + SDL_AtomicAdd(&self->dirty, 1); +} + +/* This should only be called on the thread on which a user is using the context. */ +- (void)updateIfNeeded +{ + int value = SDL_AtomicSet(&self->dirty, 0); + if (value > 0) { + /* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */ + [super update]; + } +} + +/* This should only be called on the thread on which a user is using the context. */ +- (void)update +{ + /* This ensures that regular 'update' calls clear the atomic dirty flag. */ + [self scheduleUpdate]; + [self updateIfNeeded]; +} + +/* Updates the drawable for the contexts and manages related state. */ +- (void)setWindow:(SDL_Window *)newWindow +{ + if (self->window) { + SDL_WindowData *oldwindowdata = (SDL_WindowData *)self->window->driverdata; + + /* Make sure to remove us from the old window's context list, or we'll get scheduled updates from it too. */ + NSMutableArray *contexts = oldwindowdata->nscontexts; + @synchronized (contexts) { + [contexts removeObject:self]; + } + } + + self->window = newWindow; + + if (newWindow) { + SDL_WindowData *windowdata = (SDL_WindowData *)newWindow->driverdata; + + /* Now sign up for scheduled updates for the new window. */ + NSMutableArray *contexts = windowdata->nscontexts; + @synchronized (contexts) { + [contexts addObject:self]; + } + + if ([self view] != [windowdata->nswindow contentView]) { + [self setView:[windowdata->nswindow contentView]]; + [self scheduleUpdate]; + } + } else { + [self clearDrawable]; + [self scheduleUpdate]; + } +} + +@end + int Cocoa_GL_LoadLibrary(_THIS, const char *path) @@ -89,7 +162,8 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; NSOpenGLPixelFormatAttribute attr[32]; NSOpenGLPixelFormat *fmt; - NSOpenGLContext *context; + SDLOpenGLContext *context; + NSOpenGLContext *share_context = nil; int i = 0; if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { @@ -118,12 +192,6 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) attr[i++] = profile; } -#ifndef FULLSCREEN_TOGGLEABLE - if (window->flags & SDL_WINDOW_FULLSCREEN) { - attr[i++] = NSOpenGLPFAFullScreen; - } -#endif - attr[i++] = NSOpenGLPFAColorSize; attr[i++] = SDL_BYTESPERPIXEL(display->current_mode.format)*8; @@ -182,7 +250,11 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) return NULL; } - context = [[NSOpenGLContext alloc] initWithFormat:fmt shareContext:nil]; + if (_this->gl_config.share_with_current_context) { + share_context = (NSOpenGLContext*)SDL_GL_GetCurrentContext(); + } + + context = [[SDLOpenGLContext alloc] initWithFormat:fmt shareContext:share_context]; [fmt release]; @@ -192,31 +264,6 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) return NULL; } - /* - * Wisdom from Apple engineer in reference to UT2003's OpenGL performance: - * "You are blowing a couple of the internal OpenGL function caches. This - * appears to be happening in the VAO case. You can tell OpenGL to up - * the cache size by issuing the following calls right after you create - * the OpenGL context. The default cache size is 16." --ryan. - */ - - #ifndef GLI_ARRAY_FUNC_CACHE_MAX - #define GLI_ARRAY_FUNC_CACHE_MAX 284 - #endif - - #ifndef GLI_SUBMIT_FUNC_CACHE_MAX - #define GLI_SUBMIT_FUNC_CACHE_MAX 280 - #endif - - { - GLint cache_max = 64; - CGLContextObj ctx = [context CGLContextObj]; - CGLSetParameter (ctx, GLI_SUBMIT_FUNC_CACHE_MAX, &cache_max); - CGLSetParameter (ctx, GLI_ARRAY_FUNC_CACHE_MAX, &cache_max); - } - - /* End Wisdom from Apple Engineer section. --ryan. */ - [pool release]; if ( Cocoa_GL_MakeCurrent(_this, window, context) < 0 ) { @@ -235,20 +282,9 @@ Cocoa_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) pool = [[NSAutoreleasePool alloc] init]; if (context) { - SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata; - NSOpenGLContext *nscontext = (NSOpenGLContext *)context; - - if (window->flags & SDL_WINDOW_SHOWN) { -#ifndef FULLSCREEN_TOGGLEABLE - if (window->flags & SDL_WINDOW_FULLSCREEN) { - [nscontext setFullScreen]; - } else -#endif - { - [nscontext setView:[windowdata->nswindow contentView]]; - [nscontext update]; - } - } + SDLOpenGLContext *nscontext = (SDLOpenGLContext *)context; + [nscontext setWindow:window]; + [nscontext updateIfNeeded]; [nscontext makeCurrentContext]; } else { [NSOpenGLContext clearCurrentContext]; @@ -268,7 +304,7 @@ Cocoa_GL_SetSwapInterval(_THIS, int interval) pool = [[NSAutoreleasePool alloc] init]; - nscontext = [NSOpenGLContext currentContext]; + nscontext = (NSOpenGLContext*)SDL_GL_GetCurrentContext(); if (nscontext != nil) { value = interval; [nscontext setValues:&value forParameter:NSOpenGLCPSwapInterval]; @@ -291,7 +327,7 @@ Cocoa_GL_GetSwapInterval(_THIS) pool = [[NSAutoreleasePool alloc] init]; - nscontext = [NSOpenGLContext currentContext]; + nscontext = (NSOpenGLContext*)SDL_GL_GetCurrentContext(); if (nscontext != nil) { [nscontext getValues:&value forParameter:NSOpenGLCPSwapInterval]; status = (int)value; @@ -305,15 +341,12 @@ void Cocoa_GL_SwapWindow(_THIS, SDL_Window * window) { NSAutoreleasePool *pool; - NSOpenGLContext *nscontext; pool = [[NSAutoreleasePool alloc] init]; - /* FIXME: Do we need to get the context for the window? */ - nscontext = [NSOpenGLContext currentContext]; - if (nscontext != nil) { - [nscontext flushBuffer]; - } + SDLOpenGLContext* nscontext = (NSOpenGLContext*)SDL_GL_GetCurrentContext(); + [nscontext flushBuffer]; + [nscontext updateIfNeeded]; [pool release]; } @@ -322,11 +355,11 @@ void Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context) { NSAutoreleasePool *pool; - NSOpenGLContext *nscontext = (NSOpenGLContext *)context; + SDLOpenGLContext *nscontext = (SDLOpenGLContext *)context; pool = [[NSAutoreleasePool alloc] init]; - [nscontext clearDrawable]; + [nscontext setWindow:NULL]; [nscontext release]; [pool release]; diff --git a/src/video/cocoa/SDL_cocoashape.h b/src/video/cocoa/SDL_cocoashape.h index fc867a081..3b656c1a9 100644 --- a/src/video/cocoa/SDL_cocoashape.h +++ b/src/video/cocoa/SDL_cocoashape.h @@ -30,10 +30,10 @@ #include "../SDL_shape_internals.h" typedef struct { - NSGraphicsContext* context; - SDL_bool saved; - - SDL_ShapeTree* shape; + NSGraphicsContext* context; + SDL_bool saved; + + SDL_ShapeTree* shape; } SDL_ShapeData; extern SDL_WindowShaper* Cocoa_CreateShaper(SDL_Window* window); diff --git a/src/video/cocoa/SDL_cocoashape.m b/src/video/cocoa/SDL_cocoashape.m index 8f2fa47dc..71085261a 100644 --- a/src/video/cocoa/SDL_cocoashape.m +++ b/src/video/cocoa/SDL_cocoashape.m @@ -33,22 +33,24 @@ SDL_WindowShaper* Cocoa_CreateShaper(SDL_Window* window) { SDL_WindowData* windata = (SDL_WindowData*)window->driverdata; [windata->nswindow setOpaque:NO]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - [windata->nswindow setStyleMask:NSBorderlessWindowMask]; -#endif + + if ([windata->nswindow respondsToSelector:@selector(setStyleMask:)]) { + [windata->nswindow setStyleMask:NSBorderlessWindowMask]; + } + SDL_WindowShaper* result = result = malloc(sizeof(SDL_WindowShaper)); result->window = window; result->mode.mode = ShapeModeDefault; result->mode.parameters.binarizationCutoff = 1; result->userx = result->usery = 0; window->shaper = result; - + SDL_ShapeData* data = malloc(sizeof(SDL_ShapeData)); result->driverdata = data; data->context = [windata->nswindow graphicsContext]; data->saved = SDL_FALSE; data->shape = NULL; - + int resized_properly = Cocoa_ResizeWindowShape(window); SDL_assert(resized_properly == 0); return result; @@ -72,28 +74,29 @@ ConvertRects(SDL_ShapeTree* tree,void* closure) { int Cocoa_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) { SDL_ShapeData* data = (SDL_ShapeData*)shaper->driverdata; - SDL_WindowData* windata = (SDL_WindowData*)shaper->window->driverdata; - SDL_CocoaClosure closure; - NSAutoreleasePool *pool = NULL; + SDL_WindowData* windata = (SDL_WindowData*)shaper->window->driverdata; + SDL_CocoaClosure closure; + NSAutoreleasePool *pool = NULL; if(data->saved == SDL_TRUE) { [data->context restoreGraphicsState]; data->saved = SDL_FALSE; } - + //[data->context saveGraphicsState]; //data->saved = SDL_TRUE; - [NSGraphicsContext setCurrentContext:data->context]; - + [NSGraphicsContext setCurrentContext:data->context]; + [[NSColor clearColor] set]; NSRectFill([[windata->nswindow contentView] frame]); data->shape = SDL_CalculateShapeTree(*shape_mode,shape); - - pool = [[NSAutoreleasePool alloc] init]; + + pool = [[NSAutoreleasePool alloc] init]; closure.view = [windata->nswindow contentView]; closure.path = [[NSBezierPath bezierPath] autorelease]; - closure.window = shaper->window; + closure.window = shaper->window; SDL_TraverseShapeTree(data->shape,&ConvertRects,&closure); [closure.path addClip]; + [pool release]; return 0; } diff --git a/src/video/cocoa/SDL_cocoavideo.h b/src/video/cocoa/SDL_cocoavideo.h index cde0a38cf..5f8be5316 100644 --- a/src/video/cocoa/SDL_cocoavideo.h +++ b/src/video/cocoa/SDL_cocoavideo.h @@ -39,16 +39,6 @@ #include "SDL_cocoaopengl.h" #include "SDL_cocoawindow.h" -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 -#if __LP64__ -typedef long NSInteger; -typedef unsigned long NSUInteger; -#else -typedef int NSInteger; -typedef unsigned int NSUInteger; -#endif -#endif - /* Private display data */ @class SDLTranslatorResponder; diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m index 30e03f098..849915247 100644 --- a/src/video/cocoa/SDL_cocoavideo.m +++ b/src/video/cocoa/SDL_cocoavideo.m @@ -22,7 +22,7 @@ #if SDL_VIDEO_DRIVER_COCOA -#if defined(__APPLE__) && defined(__POWERPC__) +#if defined(__APPLE__) && defined(__POWERPC__) && !defined(__APPLE_ALTIVEC__) #include #undef bool #undef vector @@ -110,11 +110,11 @@ Cocoa_CreateDevice(int devindex) device->SetWindowGrab = Cocoa_SetWindowGrab; device->DestroyWindow = Cocoa_DestroyWindow; device->GetWindowWMInfo = Cocoa_GetWindowWMInfo; - + device->shape_driver.CreateShaper = Cocoa_CreateShaper; device->shape_driver.SetWindowShape = Cocoa_SetWindowShape; device->shape_driver.ResizeWindowShape = Cocoa_ResizeWindowShape; - + #if SDL_VIDEO_OPENGL_CGL device->GL_LoadLibrary = Cocoa_GL_LoadLibrary; device->GL_GetProcAddress = Cocoa_GL_GetProcAddress; @@ -173,7 +173,7 @@ Cocoa_CreateImage(SDL_Surface * surface) int i; NSImage *img; - converted = SDL_ConvertSurfaceFormat(surface, + converted = SDL_ConvertSurfaceFormat(surface, #if SDL_BYTEORDER == SDL_BIG_ENDIAN SDL_PIXELFORMAT_RGBA8888, #else @@ -232,59 +232,6 @@ void SDL_NSLog(const char *text) NSLog(@"%s", text); } -/* - * Mac OS X assertion support. - * - * This doesn't really have aything to do with the interfaces of the SDL video - * subsystem, but we need to stuff this into an Objective-C source code file. - */ - -SDL_assert_state -SDL_PromptAssertion_cocoa(const SDL_assert_data *data) -{ - const int initialized = (SDL_WasInit(SDL_INIT_VIDEO) != 0); - if (!initialized) { - if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1) { - fprintf(stderr, "Assertion failed AND couldn't init video mode!\n"); - return SDL_ASSERTION_BREAK; /* oh well, crash hard. */ - } - } - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSString *msg = [NSString stringWithFormat: - @"Assertion failure at %s (%s:%d), triggered %u time%s:\n '%s'", - data->function, data->filename, data->linenum, - data->trigger_count, (data->trigger_count == 1) ? "" : "s", - data->condition]; - - NSLog(@"%@", msg); - - /* - * !!! FIXME: this code needs to deal with fullscreen modes: - * !!! FIXME: reset to default desktop, runModal, reset to current? - */ - - NSAlert* alert = [[NSAlert alloc] init]; - [alert setAlertStyle:NSCriticalAlertStyle]; - [alert setMessageText:msg]; - [alert addButtonWithTitle:@"Retry"]; - [alert addButtonWithTitle:@"Break"]; - [alert addButtonWithTitle:@"Abort"]; - [alert addButtonWithTitle:@"Ignore"]; - [alert addButtonWithTitle:@"Always Ignore"]; - const NSInteger clicked = [alert runModal]; - [alert release]; - - [pool release]; - - if (!initialized) { - SDL_QuitSubSystem(SDL_INIT_VIDEO); - } - - return (SDL_assert_state) (clicked - NSAlertFirstButtonReturn); -} - #endif /* SDL_VIDEO_DRIVER_COCOA */ /* vim: set ts=4 sw=4 expandtab: */ diff --git a/src/video/cocoa/SDL_cocoawindow.h b/src/video/cocoa/SDL_cocoawindow.h index 24ad71f1a..022694f52 100644 --- a/src/video/cocoa/SDL_cocoawindow.h +++ b/src/video/cocoa/SDL_cocoawindow.h @@ -27,16 +27,15 @@ typedef struct SDL_WindowData SDL_WindowData; -/* *INDENT-OFF* */ -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 @interface Cocoa_WindowListener : NSResponder { -#else -@interface Cocoa_WindowListener : NSResponder { -#endif SDL_WindowData *_data; + BOOL observingVisible; + BOOL wasVisible; } -(void) listen:(SDL_WindowData *) data; +-(void) pauseVisibleObservation; +-(void) resumeVisibleObservation; -(void) close; /* Window delegate functionality */ @@ -78,10 +77,13 @@ typedef enum { @end /* *INDENT-ON* */ +@class SDLOpenGLContext; + struct SDL_WindowData { SDL_Window *window; NSWindow *nswindow; + NSMutableArray *nscontexts; SDL_bool created; Cocoa_WindowListener *listener; struct SDL_VideoData *videodata; diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index f2803dad3..9cee4d3ba 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -32,6 +32,7 @@ #include "SDL_cocoavideo.h" #include "SDL_cocoashape.h" #include "SDL_cocoamouse.h" +#include "SDL_cocoaopengl.h" static Uint32 s_moveHack; @@ -41,6 +42,16 @@ static __inline__ void ConvertNSRect(NSRect *r) r->origin.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - r->origin.y - r->size.height; } +static void ScheduleContextUpdates(SDL_WindowData *data) +{ + NSMutableArray *contexts = data->nscontexts; + @synchronized (contexts) { + for (SDLOpenGLContext *context in contexts) { + [context scheduleUpdate]; + } + } +} + @implementation Cocoa_WindowListener - (void)listen:(SDL_WindowData *)data @@ -50,6 +61,8 @@ static __inline__ void ConvertNSRect(NSRect *r) NSView *view = [window contentView]; _data = data; + observingVisible = YES; + wasVisible = [window isVisible]; center = [NSNotificationCenter defaultCenter]; @@ -65,16 +78,63 @@ static __inline__ void ConvertNSRect(NSRect *r) [window setDelegate:self]; } + /* Haven't found a delegate / notification that triggers when the window is + * ordered out (is not visible any more). You can be ordered out without + * minimizing, so DidMiniaturize doesn't work. (e.g. -[NSWindow orderOut:]) + */ + [window addObserver:self + forKeyPath:@"visible" + options:NSKeyValueObservingOptionNew + context:NULL]; + [window setNextResponder:self]; [window setAcceptsMouseMovedEvents:YES]; [view setNextResponder:self]; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 if ([view respondsToSelector:@selector(setAcceptsTouchEvents:)]) { [view setAcceptsTouchEvents:YES]; } -#endif +} + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(NSDictionary *)change + context:(void *)context +{ + if (!observingVisible) { + return; + } + + if (object == _data->nswindow && [keyPath isEqualToString:@"visible"]) { + int newVisibility = [[change objectForKey:@"new"] intValue]; + if (newVisibility) { + SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_SHOWN, 0, 0); + } else { + SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0); + } + } +} + +-(void) pauseVisibleObservation +{ + observingVisible = NO; + wasVisible = [_data->nswindow isVisible]; +} + +-(void) resumeVisibleObservation +{ + BOOL isVisible = [_data->nswindow isVisible]; + observingVisible = YES; + if (wasVisible != isVisible) { + if (isVisible) { + SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_SHOWN, 0, 0); + } else { + SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0); + } + + wasVisible = isVisible; + } } - (void)close @@ -82,6 +142,7 @@ static __inline__ void ConvertNSRect(NSRect *r) NSNotificationCenter *center; NSWindow *window = _data->nswindow; NSView *view = [window contentView]; + NSArray *windows = nil; center = [NSNotificationCenter defaultCenter]; @@ -97,12 +158,30 @@ static __inline__ void ConvertNSRect(NSRect *r) [window setDelegate:nil]; } + [window removeObserver:self + forKeyPath:@"visible"]; + if ([window nextResponder] == self) { [window setNextResponder:nil]; } if ([view nextResponder] == self) { [view setNextResponder:nil]; } + + /* Make the next window in the z-order Key. If we weren't the foreground + when closed, this is a no-op. + !!! FIXME: Note that this is a hack, and there are corner cases where + !!! FIXME: this fails (such as the About box). The typical nib+RunLoop + !!! FIXME: handles this for Cocoa apps, but we bypass all that in SDL. + !!! FIXME: We should remove this code when we find a better way to + !!! FIXME: have the system do this for us. See discussion in + !!! FIXME: http://bugzilla.libsdl.org/show_bug.cgi?id=1825 + */ + windows = [NSApp orderedWindows]; + if ([windows count] > 0) { + NSWindow *win = (NSWindow *) [windows objectAtIndex:0]; + [win makeKeyAndOrderFront:self]; + } } - (BOOL)windowShouldClose:(id)sender @@ -119,7 +198,6 @@ static __inline__ void ConvertNSRect(NSRect *r) - (void)windowDidMove:(NSNotification *)aNotification { int x, y; - SDL_VideoDevice *device = SDL_GetVideoDevice(); SDL_Window *window = _data->window; NSWindow *nswindow = _data->nswindow; NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]]; @@ -143,16 +221,13 @@ static __inline__ void ConvertNSRect(NSRect *r) x = (int)rect.origin.x; y = (int)rect.origin.y; - if (window == device->current_glwin) { - [((NSOpenGLContext *) device->current_glctx) update]; - } + ScheduleContextUpdates(_data); SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y); } - (void)windowDidResize:(NSNotification *)aNotification { - SDL_VideoDevice *device = SDL_GetVideoDevice(); int x, y, w, h; NSRect rect = [_data->nswindow contentRectForFrameRect:[_data->nswindow frame]]; ConvertNSRect(&rect); @@ -163,14 +238,19 @@ static __inline__ void ConvertNSRect(NSRect *r) if (SDL_IsShapedWindow(_data->window)) Cocoa_ResizeWindowShape(_data->window); - if (_data->window == device->current_glwin) { - [((NSOpenGLContext *) device->current_glctx) update]; - } + ScheduleContextUpdates(_data); /* The window can move during a resize event, such as when maximizing or resizing from a corner */ SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MOVED, x, y); SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESIZED, w, h); + + const BOOL zoomed = [_data->nswindow isZoomed]; + if (!zoomed) { + SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESTORED, 0, 0); + } else if (zoomed) { + SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); + } } - (void)windowDidMiniaturize:(NSNotification *)aNotification @@ -186,12 +266,13 @@ static __inline__ void ConvertNSRect(NSRect *r) - (void)windowDidBecomeKey:(NSNotification *)aNotification { SDL_Window *window = _data->window; + SDL_Mouse *mouse = SDL_GetMouse(); /* We're going to get keyboard events, since we're key. */ SDL_SetKeyboardFocus(window); /* If we just gained focus we need the updated mouse position */ - { + if (!mouse->relative_mode) { NSPoint point; int x, y; @@ -201,7 +282,6 @@ static __inline__ void ConvertNSRect(NSRect *r) if (x >= 0 && x < window->w && y >= 0 && y < window->h) { SDL_SendMouseMotion(window, 0, 0, x, y); - SDL_SetCursor(NULL); } } @@ -222,27 +302,29 @@ static __inline__ void ConvertNSRect(NSRect *r) } } -// We'll respond to key events by doing nothing so we don't beep. -// We could handle key messages here, but we lose some in the NSApp dispatch, -// where they get converted to action messages, etc. +/* We'll respond to key events by doing nothing so we don't beep. + * We could handle key messages here, but we lose some in the NSApp dispatch, + * where they get converted to action messages, etc. + */ - (void)flagsChanged:(NSEvent *)theEvent { - //Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent); + /*Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent);*/ } - (void)keyDown:(NSEvent *)theEvent { - //Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent); + /*Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent);*/ } - (void)keyUp:(NSEvent *)theEvent { - //Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent); + /*Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent);*/ } -// We'll respond to selectors by doing nothing so we don't beep. -// The escape key gets converted to a "cancel" selector, etc. +/* We'll respond to selectors by doing nothing so we don't beep. + * The escape key gets converted to a "cancel" selector, etc. + */ - (void)doCommandBySelector:(SEL)aSelector { - //NSLog(@"doCommandBySelector: %@\n", NSStringFromSelector(aSelector)); + /*NSLog(@"doCommandBySelector: %@\n", NSStringFromSelector(aSelector));*/ } - (void)mouseDown:(NSEvent *)theEvent @@ -337,9 +419,22 @@ static __inline__ void ConvertNSRect(NSRect *r) y = window->h - 1; } +#if !SDL_MAC_NO_SANDBOX + /* When SDL_MAC_NO_SANDBOX is set, this is handled by + * SDL_cocoamousetap.m. + */ + cgpoint.x = window->x + x; cgpoint.y = window->y + y; + + /* According to the docs, this was deprecated in 10.6, but it's still + * around. The substitute requires a CGEventSource, but I'm not entirely + * sure how we'd procure the right one for this event. + */ + CGSetLocalEventsSuppressionInterval(0.0); CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint); + CGSetLocalEventsSuppressionInterval(0.25); +#endif } } SDL_SendMouseMotion(window, 0, 0, x, y); @@ -387,7 +482,6 @@ static __inline__ void ConvertNSRect(NSRect *r) - (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 NSSet *touches = 0; NSEnumerator *enumerator; NSTouch *touch; @@ -413,7 +507,7 @@ static __inline__ void ConvertNSRect(NSRect *r) if (SDL_AddTouch(touchId, "") < 0) { return; } - } + } const SDL_FingerID fingerId = (SDL_FingerID)(intptr_t)[touch identity]; float x = [touch normalizedPosition].x; @@ -436,7 +530,6 @@ static __inline__ void ConvertNSRect(NSRect *r) touch = (NSTouch*)[enumerator nextObject]; } -#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 */ } @end @@ -460,6 +553,7 @@ static __inline__ void ConvertNSRect(NSRect *r) @end @interface SDLView : NSView + /* The default implementation doesn't pass rightMouseDown to responder chain */ - (void)rightMouseDown:(NSEvent *)theEvent; @end @@ -469,6 +563,20 @@ static __inline__ void ConvertNSRect(NSRect *r) { [[self nextResponder] rightMouseDown:theEvent]; } + +- (void)resetCursorRects +{ + [super resetCursorRects]; + SDL_Mouse *mouse = SDL_GetMouse(); + + if (mouse->cursor_shown && mouse->cur_cursor && !mouse->relative_mode) { + [self addCursorRect:[self bounds] + cursor:mouse->cur_cursor->driverdata]; + } else { + [self addCursorRect:[self bounds] + cursor:[NSCursor invisibleCursor]]; + } +} @end static unsigned int @@ -476,18 +584,18 @@ GetWindowStyle(SDL_Window * window) { unsigned int style; - if (window->flags & SDL_WINDOW_FULLSCREEN) { + if (window->flags & SDL_WINDOW_FULLSCREEN) { style = NSBorderlessWindowMask; - } else { - if (window->flags & SDL_WINDOW_BORDERLESS) { - style = NSBorderlessWindowMask; - } else { - style = (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask); - } - if (window->flags & SDL_WINDOW_RESIZABLE) { - style |= NSResizableWindowMask; - } - } + } else { + if (window->flags & SDL_WINDOW_BORDERLESS) { + style = NSBorderlessWindowMask; + } else { + style = (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask); + } + if (window->flags & SDL_WINDOW_RESIZABLE) { + style |= NSResizableWindowMask; + } + } return style; } @@ -507,6 +615,7 @@ SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created data->nswindow = nswindow; data->created = created; data->videodata = videodata; + data->nscontexts = [[NSMutableArray alloc] init]; pool = [[NSAutoreleasePool alloc] init]; @@ -531,6 +640,7 @@ SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created } else { window->flags &= ~SDL_WINDOW_SHOWN; } + { unsigned int style = [nswindow styleMask]; @@ -545,22 +655,30 @@ SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created window->flags &= ~SDL_WINDOW_RESIZABLE; } } + /* isZoomed always returns true if the window is not resizable */ if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed]) { window->flags |= SDL_WINDOW_MAXIMIZED; } else { window->flags &= ~SDL_WINDOW_MAXIMIZED; } + if ([nswindow isMiniaturized]) { window->flags |= SDL_WINDOW_MINIMIZED; } else { window->flags &= ~SDL_WINDOW_MINIMIZED; } + if ([nswindow isKeyWindow]) { window->flags |= SDL_WINDOW_INPUT_FOCUS; SDL_SetKeyboardFocus(data->window); } + /* Prevents the window's "window device" from being destroyed when it is + * hidden. See http://www.mikeash.com/pyblog/nsopenglcontext-and-one-shot.html + */ + [nswindow setOneShot:NO]; + /* All done! */ [pool release]; window->driverdata = data; @@ -603,9 +721,10 @@ Cocoa_CreateWindow(_THIS, SDL_Window * window) rect.origin.y -= screenRect.origin.y; } } - nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:YES screen:screen]; + nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO screen:screen]; + [nswindow setBackgroundColor:[NSColor blackColor]]; - // Create a default view for this window + /* Create a default view for this window */ rect = [nswindow contentRectForFrameRect:[nswindow frame]]; NSView *contentView = [[SDLView alloc] initWithFrame:rect]; [nswindow setContentView: contentView]; @@ -675,7 +794,8 @@ void Cocoa_SetWindowPosition(_THIS, SDL_Window * window) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow; + SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; + NSWindow *nswindow = windata->nswindow; NSRect rect; Uint32 moveHack; @@ -690,9 +810,7 @@ Cocoa_SetWindowPosition(_THIS, SDL_Window * window) [nswindow setFrameOrigin:rect.origin]; s_moveHack = moveHack; - if (window == _this->current_glwin) { - [((NSOpenGLContext *) _this->current_glctx) update]; - } + ScheduleContextUpdates(windata); [pool release]; } @@ -709,9 +827,7 @@ Cocoa_SetWindowSize(_THIS, SDL_Window * window) size.height = window->h; [nswindow setContentSize:size]; - if (window == _this->current_glwin) { - [((NSOpenGLContext *) _this->current_glctx) update]; - } + ScheduleContextUpdates(windata); [pool release]; } @@ -721,13 +837,13 @@ Cocoa_SetWindowMinimumSize(_THIS, SDL_Window * window) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; - + NSSize minSize; minSize.width = window->min_w; minSize.height = window->min_h; - + [windata->nswindow setContentMinSize:minSize]; - + [pool release]; } @@ -736,13 +852,13 @@ Cocoa_SetWindowMaximumSize(_THIS, SDL_Window * window) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; - + NSSize maxSize; maxSize.width = window->max_w; maxSize.height = window->max_h; - + [windata->nswindow setContentMaxSize:maxSize]; - + [pool release]; } @@ -750,10 +866,13 @@ void Cocoa_ShowWindow(_THIS, SDL_Window * window) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow; + SDL_WindowData *windowData = ((SDL_WindowData *) window->driverdata); + NSWindow *nswindow = windowData->nswindow; if (![nswindow isMiniaturized]) { + [windowData->listener pauseVisibleObservation]; [nswindow makeKeyAndOrderFront:nil]; + [windowData->listener resumeVisibleObservation]; } [pool release]; } @@ -772,9 +891,17 @@ void Cocoa_RaiseWindow(_THIS, SDL_Window * window) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow; + SDL_WindowData *windowData = ((SDL_WindowData *) window->driverdata); + NSWindow *nswindow = windowData->nswindow; + + // makeKeyAndOrderFront: has the side-effect of deminiaturizing and showing + // a minimized or hidden window, so check for that before showing it. + [windowData->listener pauseVisibleObservation]; + if (![nswindow isMiniaturized] && [nswindow isVisible]) { + [nswindow makeKeyAndOrderFront:nil]; + } + [windowData->listener resumeVisibleObservation]; - [nswindow makeKeyAndOrderFront:nil]; [pool release]; } @@ -782,13 +909,12 @@ void Cocoa_MaximizeWindow(_THIS, SDL_Window * window) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow; + SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; + NSWindow *nswindow = windata->nswindow; [nswindow zoom:nil]; - if (window == _this->current_glwin) { - [((NSOpenGLContext *) _this->current_glctx) update]; - } + ScheduleContextUpdates(windata); [pool release]; } @@ -826,8 +952,10 @@ Cocoa_RebuildWindow(SDL_WindowData * data, NSWindow * nswindow, unsigned style) } [data->listener close]; - data->nswindow = [[SDLWindow alloc] initWithContentRect:[[nswindow contentView] frame] styleMask:style backing:NSBackingStoreBuffered defer:YES screen:[nswindow screen]]; + data->nswindow = [[SDLWindow alloc] initWithContentRect:[[nswindow contentView] frame] styleMask:style backing:NSBackingStoreBuffered defer:NO screen:[nswindow screen]]; [data->nswindow setContentView:[nswindow contentView]]; + /* See comment in SetupWindowData. */ + [data->nswindow setOneShot:NO]; [data->listener listen:data]; [nswindow close]; @@ -838,18 +966,15 @@ Cocoa_RebuildWindow(SDL_WindowData * data, NSWindow * nswindow, unsigned style) void Cocoa_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) { - /* this message arrived in 10.6. You're out of luck on older OSes. */ -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow; if ([nswindow respondsToSelector:@selector(setStyleMask:)]) { [nswindow setStyleMask:GetWindowStyle(window)]; if (bordered) { - Cocoa_SetWindowTitle(_this, window); // this got blanked out. + Cocoa_SetWindowTitle(_this, window); /* this got blanked out. */ } } [pool release]; -#endif } void @@ -915,19 +1040,18 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display Cocoa_SetWindowTitle(_this, window); } -#ifdef FULLSCREEN_TOGGLEABLE if (SDL_ShouldAllowTopmost() && fullscreen) { /* OpenGL is rendering to the window, so make it visible! */ [nswindow setLevel:CGShieldingWindowLevel()]; } else { [nswindow setLevel:kCGNormalWindowLevel]; } -#endif - [nswindow makeKeyAndOrderFront:nil]; - if (window == _this->current_glwin) { - [((NSOpenGLContext *) _this->current_glctx) update]; - } + [data->listener pauseVisibleObservation]; + [nswindow makeKeyAndOrderFront:nil]; + [data->listener resumeVisibleObservation]; + + ScheduleContextUpdates(data); [pool release]; } @@ -995,17 +1119,17 @@ Cocoa_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) cgpoint.y = window->y + y; CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint); } - - if ( window->flags & SDL_WINDOW_FULLSCREEN ) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { - /* OpenGL is rendering to the window, so make it visible! */ - [data->nswindow setLevel:CGShieldingWindowLevel()]; - } else { - [data->nswindow setLevel:kCGNormalWindowLevel]; - } - } + if ( window->flags & SDL_WINDOW_FULLSCREEN ) { + SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + + if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { + /* OpenGL is rendering to the window, so make it visible! */ + [data->nswindow setLevel:CGShieldingWindowLevel()]; + } else { + [data->nswindow setLevel:kCGNormalWindowLevel]; + } + } } void @@ -1020,6 +1144,14 @@ Cocoa_DestroyWindow(_THIS, SDL_Window * window) if (data->created) { [data->nswindow close]; } + + NSArray *contexts = [[data->nscontexts copy] autorelease]; + for (SDLOpenGLContext *context in contexts) { + /* Calling setWindow:NULL causes the context to remove itself from the context list. */ + [context setWindow:NULL]; + } + [data->nscontexts release]; + SDL_free(data); } [pool release]; diff --git a/src/video/directfb/SDL_DirectFB_WM.c b/src/video/directfb/SDL_DirectFB_WM.c index 84e76ca1c..8241d9b3d 100644 --- a/src/video/directfb/SDL_DirectFB_WM.c +++ b/src/video/directfb/SDL_DirectFB_WM.c @@ -81,24 +81,24 @@ LoadFont(_THIS, SDL_Window * window) SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); - if (windata->font != NULL) { - SDL_DFB_RELEASE(windata->font); - windata->font = NULL; - SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font)); - } - - if (windata->theme.font != NULL) - { + if (windata->font != NULL) { + SDL_DFB_RELEASE(windata->font); + windata->font = NULL; + SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font)); + } + + if (windata->theme.font != NULL) + { DFBFontDescription fdesc; - SDL_zero(fdesc); - fdesc.flags = DFDESC_HEIGHT; - fdesc.height = windata->theme.font_size; - SDL_DFB_CHECK(devdata-> - dfb->CreateFont(devdata->dfb, windata->theme.font, - &fdesc, &windata->font)); - SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font)); - } + SDL_zero(fdesc); + fdesc.flags = DFDESC_HEIGHT; + fdesc.height = windata->theme.font_size; + SDL_DFB_CHECK(devdata-> + dfb->CreateFont(devdata->dfb, windata->theme.font, + &fdesc, &windata->font)); + SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font)); + } } static void @@ -130,8 +130,8 @@ DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window) SDL_DFB_CHECK(s->SetDrawingFlags(s, DSDRAW_NOFX)); SDL_DFB_CHECK(s->SetBlittingFlags(s, DSBLIT_NOFX)); - LoadFont(_this, window); - //s->SetDrawingFlags(s, DSDRAW_BLEND); + LoadFont(_this, window); + /*s->SetDrawingFlags(s, DSDRAW_BLEND); */ s->SetColor(s, COLOR_EXPAND(t->frame_color)); /* top */ for (i = 0; i < t->top_size; i++) @@ -162,7 +162,7 @@ DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window) /* Caption */ if (window->title) { - s->SetColor(s, COLOR_EXPAND(t->font_color)); + s->SetColor(s, COLOR_EXPAND(t->font_color)); DrawCraption(_this, s, (x - w) / 2, t->top_size + d, window->title); } /* Icon */ @@ -184,7 +184,7 @@ DFBResult DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch) { SDL_DFB_WINDOWDATA(window); - IDirectFBWindow *dfbwin = windata->dfbwin; + IDirectFBWindow *dfbwin = windata->dfbwin; SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, cw, ch)); dfbwin->GetSize(dfbwin, cw, ch); @@ -203,8 +203,8 @@ DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h) if (!windata->is_managed) windata->theme = theme_none; else if (flags & SDL_WINDOW_BORDERLESS) - //desc.caps |= DWCAPS_NODECORATION;) - windata->theme = theme_none; + /*desc.caps |= DWCAPS_NODECORATION;) */ + windata->theme = theme_none; else if (flags & SDL_WINDOW_FULLSCREEN) { windata->theme = theme_none; } else if (flags & SDL_WINDOW_MAXIMIZED) { @@ -289,8 +289,8 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) { SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); - DFB_WindowData *gwindata = ((devdata->grabbed_window) ? (DFB_WindowData *) ((devdata->grabbed_window)->driverdata) : NULL); - IDirectFBWindow *dfbwin = windata->dfbwin; + DFB_WindowData *gwindata = ((devdata->grabbed_window) ? (DFB_WindowData *) ((devdata->grabbed_window)->driverdata) : NULL); + IDirectFBWindow *dfbwin = windata->dfbwin; DFBWindowOptions wopts; if (!windata->is_managed) @@ -306,29 +306,29 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) case WM_POS_NONE: return 0; case WM_POS_CLOSE: - windata->wm_grab = WM_POS_NONE; + windata->wm_grab = WM_POS_NONE; SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0, 0); return 1; case WM_POS_MAX: - windata->wm_grab = WM_POS_NONE; - if (window->flags & SDL_WINDOW_MAXIMIZED) { - SDL_RestoreWindow(window); - } else { - SDL_MaximizeWindow(window); - } + windata->wm_grab = WM_POS_NONE; + if (window->flags & SDL_WINDOW_MAXIMIZED) { + SDL_RestoreWindow(window); + } else { + SDL_MaximizeWindow(window); + } return 1; case WM_POS_CAPTION: - if (!(wopts & DWOP_KEEP_STACKING)) { - DirectFB_RaiseWindow(_this, window); - } - if (window->flags & SDL_WINDOW_MAXIMIZED) - return 1; + if (!(wopts & DWOP_KEEP_STACKING)) { + DirectFB_RaiseWindow(_this, window); + } + if (window->flags & SDL_WINDOW_MAXIMIZED) + return 1; /* fall through */ default: windata->wm_grab = pos; if (gwindata != NULL) - SDL_DFB_CHECK(gwindata->dfbwin->UngrabPointer(gwindata->dfbwin)); + SDL_DFB_CHECK(gwindata->dfbwin->UngrabPointer(gwindata->dfbwin)); SDL_DFB_CHECK(dfbwin->GrabPointer(dfbwin)); windata->wm_lastx = evt->cx; windata->wm_lasty = evt->cy; @@ -343,21 +343,21 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) int dx = evt->cx - windata->wm_lastx; int dy = evt->cy - windata->wm_lasty; - if (!(wopts & DWOP_KEEP_SIZE)) { + if (!(wopts & DWOP_KEEP_SIZE)) { int cw, ch; - if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM) - dx = 0; - else if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT) - dy = 0; - SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, &cw, &ch)); + if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM) + dx = 0; + else if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT) + dy = 0; + SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, &cw, &ch)); - /* necessary to trigger an event - ugly*/ - SDL_DFB_CHECK(dfbwin->DisableEvents(dfbwin, DWET_ALL)); - SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx + 1, ch + dy)); - SDL_DFB_CHECK(dfbwin->EnableEvents(dfbwin, DWET_ALL)); + /* necessary to trigger an event - ugly*/ + SDL_DFB_CHECK(dfbwin->DisableEvents(dfbwin, DWET_ALL)); + SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx + 1, ch + dy)); + SDL_DFB_CHECK(dfbwin->EnableEvents(dfbwin, DWET_ALL)); - SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx, ch + dy)); - } + SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx, ch + dy)); + } } SDL_DFB_CHECK(dfbwin->UngrabPointer(dfbwin)); if (gwindata != NULL) @@ -370,34 +370,34 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) if (!windata->wm_grab) return 0; if (evt->buttons & DIBM_LEFT) { - int dx = evt->cx - windata->wm_lastx; + int dx = evt->cx - windata->wm_lastx; int dy = evt->cy - windata->wm_lasty; if (windata->wm_grab & WM_POS_CAPTION) { - if (!(wopts & DWOP_KEEP_POSITION)) - SDL_DFB_CHECK(dfbwin->Move(dfbwin, dx, dy)); + if (!(wopts & DWOP_KEEP_POSITION)) + SDL_DFB_CHECK(dfbwin->Move(dfbwin, dx, dy)); } if (windata->wm_grab & (WM_POS_RIGHT | WM_POS_BOTTOM)) { - if (!(wopts & DWOP_KEEP_SIZE)) { - int cw, ch; + if (!(wopts & DWOP_KEEP_SIZE)) { + int cw, ch; - /* Make sure all events are disabled for this operation ! */ - SDL_DFB_CHECK(dfbwin->DisableEvents(dfbwin, DWET_ALL)); + /* Make sure all events are disabled for this operation ! */ + SDL_DFB_CHECK(dfbwin->DisableEvents(dfbwin, DWET_ALL)); - if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM) - dx = 0; - else if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT) - dy = 0; + if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM) + dx = 0; + else if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT) + dy = 0; - SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, &cw, &ch)); - SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx, ch + dy)); + SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, &cw, &ch)); + SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx, ch + dy)); - SDL_DFB_CHECK(dfbwin->EnableEvents(dfbwin, DWET_ALL)); - } + SDL_DFB_CHECK(dfbwin->EnableEvents(dfbwin, DWET_ALL)); + } } - windata->wm_lastx = evt->cx; - windata->wm_lasty = evt->cy; - return 1; + windata->wm_lastx = evt->cx; + windata->wm_lasty = evt->cy; + return 1; } break; case DWET_KEYDOWN: diff --git a/src/video/directfb/SDL_DirectFB_dyn.c b/src/video/directfb/SDL_DirectFB_dyn.c index 496909252..cbbfa175b 100644 --- a/src/video/directfb/SDL_DirectFB_dyn.c +++ b/src/video/directfb/SDL_DirectFB_dyn.c @@ -32,7 +32,7 @@ #define DFB_SYM(ret, name, args, al, func) ret (*name) args; static struct _SDL_DirectFB_Symbols { - DFB_SYMS + DFB_SYMS const unsigned int *directfb_major_version; const unsigned int *directfb_minor_version; const unsigned int *directfb_micro_version; diff --git a/src/video/directfb/SDL_DirectFB_dyn.h b/src/video/directfb/SDL_DirectFB_dyn.h index de90961a6..52658b01f 100644 --- a/src/video/directfb/SDL_DirectFB_dyn.h +++ b/src/video/directfb/SDL_DirectFB_dyn.h @@ -23,15 +23,15 @@ #define _SDL_DirectFB_dyn_h #define DFB_SYMS \ - DFB_SYM(DFBResult, DirectFBError, (const char *msg, DFBResult result), (msg, result), return) \ - DFB_SYM(DFBResult, DirectFBErrorFatal, (const char *msg, DFBResult result), (msg, result), return) \ - DFB_SYM(const char *, DirectFBErrorString, (DFBResult result), (result), return) \ - DFB_SYM(const char *, DirectFBUsageString, ( void ), (), return) \ - DFB_SYM(DFBResult, DirectFBInit, (int *argc, char *(*argv[]) ), (argc, argv), return) \ - DFB_SYM(DFBResult, DirectFBSetOption, (const char *name, const char *value), (name, value), return) \ - DFB_SYM(DFBResult, DirectFBCreate, (IDirectFB **interface), (interface), return) \ - DFB_SYM(const char *, DirectFBCheckVersion, (unsigned int required_major, unsigned int required_minor, unsigned int required_micro), \ - (required_major, required_minor, required_micro), return) + DFB_SYM(DFBResult, DirectFBError, (const char *msg, DFBResult result), (msg, result), return) \ + DFB_SYM(DFBResult, DirectFBErrorFatal, (const char *msg, DFBResult result), (msg, result), return) \ + DFB_SYM(const char *, DirectFBErrorString, (DFBResult result), (result), return) \ + DFB_SYM(const char *, DirectFBUsageString, ( void ), (), return) \ + DFB_SYM(DFBResult, DirectFBInit, (int *argc, char *(*argv[]) ), (argc, argv), return) \ + DFB_SYM(DFBResult, DirectFBSetOption, (const char *name, const char *value), (name, value), return) \ + DFB_SYM(DFBResult, DirectFBCreate, (IDirectFB **interface), (interface), return) \ + DFB_SYM(const char *, DirectFBCheckVersion, (unsigned int required_major, unsigned int required_minor, unsigned int required_micro), \ + (required_major, required_minor, required_micro), return) int SDL_DirectFB_LoadLibrary(void); void SDL_DirectFB_UnLoadLibrary(void); diff --git a/src/video/directfb/SDL_DirectFB_events.c b/src/video/directfb/SDL_DirectFB_events.c index 8ee0b9085..483ba9cb1 100644 --- a/src/video/directfb/SDL_DirectFB_events.c +++ b/src/video/directfb/SDL_DirectFB_events.c @@ -52,11 +52,11 @@ #endif typedef struct _cb_data cb_data; -struct _cb_data +struct _cb_data { - DFB_DeviceData *devdata; - int sys_ids; - int sys_kbd; + DFB_DeviceData *devdata; + int sys_ids; + int sys_kbd; }; /* The translation tables from a DirectFB keycode to a SDL keysym */ @@ -64,9 +64,9 @@ static SDL_Scancode oskeymap[256]; static SDL_Keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, - SDL_Keysym * keysym); + SDL_Keysym * keysym, Uint32 *unicode); static SDL_Keysym *DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, - SDL_Keysym * keysym); + SDL_Keysym * keysym, Uint32 *unicode); static void DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keypmap, int numkeys); static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button); @@ -74,7 +74,7 @@ static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button); static void UnicodeToUtf8( Uint16 w , char *utf8buf) { unsigned char *utf8s = (unsigned char *) utf8buf; - + if ( w < 0x0080 ) { utf8s[0] = ( unsigned char ) w; utf8s[1] = 0; @@ -82,14 +82,14 @@ static void UnicodeToUtf8( Uint16 w , char *utf8buf) else if ( w < 0x0800 ) { utf8s[0] = 0xc0 | (( w ) >> 6 ); utf8s[1] = 0x80 | (( w ) & 0x3f ); - utf8s[2] = 0; + utf8s[2] = 0; } else { utf8s[0] = 0xe0 | (( w ) >> 12 ); utf8s[1] = 0x80 | (( ( w ) >> 6 ) & 0x3f ); utf8s[2] = 0x80 | (( w ) & 0x3f ); utf8s[3] = 0; - } + } } static void @@ -132,7 +132,7 @@ MotionAllMice(_THIS, int x, int y) SDL_Mouse *mouse = SDL_GetMouse(index); mouse->x = mouse->last_x = x; mouse->y = mouse->last_y = y; - //SDL_SendMouseMotion(devdata->mouse_id[index], 0, x, y, 0); + /*SDL_SendMouseMotion(devdata->mouse_id[index], 0, x, y, 0);*/ } #endif } @@ -176,6 +176,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(sdlwin); SDL_Keysym keysym; + Uint32 unicode; char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; if (evt->clazz == DFEC_WINDOW) { @@ -215,7 +216,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) SDL_SendMouseMotion_ex(sdlwin, devdata->mouse_id[0], 0, evt->x, evt->y, 0); } else { - /* relative movements are not exact! + /* relative movements are not exact! * This code should limit the number of events sent. * However it kills MAME axis recognition ... */ static int cnt = 0; @@ -231,12 +232,12 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) break; case DWET_KEYDOWN: if (!devdata->use_linux_input) { - DirectFB_TranslateKey(_this, evt, &keysym); - //printf("Scancode %d %d %d\n", keysym.scancode, evt->key_code, evt->key_id); + DirectFB_TranslateKey(_this, evt, &keysym, &unicode); + /*printf("Scancode %d %d %d\n", keysym.scancode, evt->key_code, evt->key_id);*/ SDL_SendKeyboardKey_ex(0, SDL_PRESSED, keysym.scancode); if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { - SDL_zero(text); - UnicodeToUtf8(keysym.unicode, text); + SDL_zero(text); + UnicodeToUtf8(unicode, text); if (*text) { SDL_SendKeyboardText_ex(0, text); } @@ -245,7 +246,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) break; case DWET_KEYUP: if (!devdata->use_linux_input) { - DirectFB_TranslateKey(_this, evt, &keysym); + DirectFB_TranslateKey(_this, evt, &keysym, &unicode); SDL_SendKeyboardKey_ex(0, SDL_RELEASED, keysym.scancode); } break; @@ -262,7 +263,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) } /* fall throught */ case DWET_SIZE: - // FIXME: what about < 0 + /* FIXME: what about < 0 */ evt->w -= (windata->theme.right_size + windata->theme.left_size); evt->h -= (windata->theme.top_size + windata->theme.bottom_size + @@ -286,7 +287,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) case DWET_ENTER: /* SDL_DirectFB_ReshowCursor(_this, 0); */ FocusAllMice(_this, sdlwin); - // FIXME: when do we really enter ? + /* FIXME: when do we really enter ? */ if (ClientXY(windata, &evt->x, &evt->y)) MotionAllMice(_this, evt->x, evt->y); SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_ENTER, 0, 0); @@ -309,6 +310,7 @@ ProcessInputEvent(_THIS, DFBInputEvent * ievt) SDL_DFB_DEVICEDATA(_this); SDL_Keysym keysym; int kbd_idx; + Uint32 unicode; char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; if (!devdata->use_linux_input) { @@ -366,12 +368,12 @@ ProcessInputEvent(_THIS, DFBInputEvent * ievt) break; case DIET_KEYPRESS: kbd_idx = KbdIndex(_this, ievt->device_id); - DirectFB_TranslateKeyInputEvent(_this, ievt, &keysym); - //printf("Scancode %d %d %d\n", keysym.scancode, evt->key_code, evt->key_id); + DirectFB_TranslateKeyInputEvent(_this, ievt, &keysym, &unicode); + /*printf("Scancode %d %d %d\n", keysym.scancode, evt->key_code, evt->key_id); */ SDL_SendKeyboardKey_ex(kbd_idx, SDL_PRESSED, keysym.scancode); if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { SDL_zero(text); - UnicodeToUtf8(keysym.unicode, text); + UnicodeToUtf8(unicode, text); if (*text) { SDL_SendKeyboardText_ex(kbd_idx, text); } @@ -379,7 +381,7 @@ ProcessInputEvent(_THIS, DFBInputEvent * ievt) break; case DIET_KEYRELEASE: kbd_idx = KbdIndex(_this, ievt->device_id); - DirectFB_TranslateKeyInputEvent(_this, ievt, &keysym); + DirectFB_TranslateKeyInputEvent(_this, ievt, &keysym, &unicode); SDL_SendKeyboardKey_ex(kbd_idx, SDL_RELEASED, keysym.scancode); break; case DIET_BUTTONPRESS: @@ -435,7 +437,7 @@ DirectFB_PumpEventsWindow(_THIS) while (devdata->events->GetEvent(devdata->events, DFB_EVENT(&ievt)) == DFB_OK) { - if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) { + if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) { SDL_SysWMmsg wmmsg; SDL_VERSION(&wmmsg.version); wmmsg.subsystem = SDL_SYSWM_DIRECTFB; @@ -575,7 +577,7 @@ DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keymap, int numkeys) } static SDL_Keysym * -DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym) +DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym, Uint32 *unicode) { SDL_DFB_DEVICEDATA(_this); int kbd_idx = 0; /* Window events lag the device source KbdIndex(_this, evt->device_id); */ @@ -584,8 +586,8 @@ DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym) keysym->scancode = SDL_SCANCODE_UNKNOWN; if (kbd->map && evt->key_code >= kbd->map_adjust && - evt->key_code < kbd->map_size + kbd->map_adjust) - keysym->scancode = kbd->map[evt->key_code - kbd->map_adjust]; + evt->key_code < kbd->map_size + kbd->map_adjust) + keysym->scancode = kbd->map[evt->key_code - kbd->map_adjust]; if (keysym->scancode == SDL_SCANCODE_UNKNOWN || devdata->keyboard[kbd_idx].is_generic) { @@ -595,18 +597,18 @@ DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym) keysym->scancode = SDL_SCANCODE_UNKNOWN; } - keysym->unicode = + *unicode = (DFB_KEY_TYPE(evt->key_symbol) == DIKT_UNICODE) ? evt->key_symbol : 0; - if (keysym->unicode == 0 && + if (*unicode == 0 && (evt->key_symbol > 0 && evt->key_symbol < 255)) - keysym->unicode = evt->key_symbol; + *unicode = evt->key_symbol; return keysym; } static SDL_Keysym * DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, - SDL_Keysym * keysym) + SDL_Keysym * keysym, Uint32 *unicode) { SDL_DFB_DEVICEDATA(_this); int kbd_idx = KbdIndex(_this, evt->device_id); @@ -615,8 +617,8 @@ DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, keysym->scancode = SDL_SCANCODE_UNKNOWN; if (kbd->map && evt->key_code >= kbd->map_adjust && - evt->key_code < kbd->map_size + kbd->map_adjust) - keysym->scancode = kbd->map[evt->key_code - kbd->map_adjust]; + evt->key_code < kbd->map_size + kbd->map_adjust) + keysym->scancode = kbd->map[evt->key_code - kbd->map_adjust]; if (keysym->scancode == SDL_SCANCODE_UNKNOWN || devdata->keyboard[kbd_idx].is_generic) { if (evt->key_id - DIKI_UNKNOWN < SDL_arraysize(oskeymap)) @@ -625,11 +627,11 @@ DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, keysym->scancode = SDL_SCANCODE_UNKNOWN; } - keysym->unicode = + *unicode = (DFB_KEY_TYPE(evt->key_symbol) == DIKT_UNICODE) ? evt->key_symbol : 0; - if (keysym->unicode == 0 && + if (*unicode == 0 && (evt->key_symbol > 0 && evt->key_symbol < 255)) - keysym->unicode = evt->key_symbol; + *unicode = evt->key_symbol; return keysym; } @@ -653,26 +655,26 @@ static DFBEnumerationResult EnumKeyboards(DFBInputDeviceID device_id, DFBInputDeviceDescription desc, void *callbackdata) { - cb_data *cb = callbackdata; + cb_data *cb = callbackdata; DFB_DeviceData *devdata = cb->devdata; #if USE_MULTI_API SDL_Keyboard keyboard; #endif SDL_Keycode keymap[SDL_NUM_SCANCODES]; - if (!cb->sys_kbd) { - if (cb->sys_ids) { - if (device_id >= 0x10) - return DFENUM_OK; - } else { - if (device_id < 0x10) - return DFENUM_OK; - } - } else { - if (device_id != DIDID_KEYBOARD) - return DFENUM_OK; - } - + if (!cb->sys_kbd) { + if (cb->sys_ids) { + if (device_id >= 0x10) + return DFENUM_OK; + } else { + if (device_id < 0x10) + return DFENUM_OK; + } + } else { + if (device_id != DIDID_KEYBOARD) + return DFENUM_OK; + } + if ((desc.caps & DIDTF_KEYBOARD)) { #if USE_MULTI_API SDL_zero(keyboard); @@ -682,17 +684,17 @@ EnumKeyboards(DFBInputDeviceID device_id, devdata->keyboard[devdata->num_keyboard].is_generic = 0; if (!strncmp("X11", desc.name, 3)) { - devdata->keyboard[devdata->num_keyboard].map = xfree86_scancode_table2; - devdata->keyboard[devdata->num_keyboard].map_size = SDL_arraysize(xfree86_scancode_table2); - devdata->keyboard[devdata->num_keyboard].map_adjust = 8; + devdata->keyboard[devdata->num_keyboard].map = xfree86_scancode_table2; + devdata->keyboard[devdata->num_keyboard].map_size = SDL_arraysize(xfree86_scancode_table2); + devdata->keyboard[devdata->num_keyboard].map_adjust = 8; } else { - devdata->keyboard[devdata->num_keyboard].map = linux_scancode_table; - devdata->keyboard[devdata->num_keyboard].map_size = SDL_arraysize(linux_scancode_table); - devdata->keyboard[devdata->num_keyboard].map_adjust = 0; + devdata->keyboard[devdata->num_keyboard].map = linux_scancode_table; + devdata->keyboard[devdata->num_keyboard].map_size = SDL_arraysize(linux_scancode_table); + devdata->keyboard[devdata->num_keyboard].map_adjust = 0; } - SDL_DFB_LOG("Keyboard %d - %s\n", device_id, desc.name); - + SDL_DFB_LOG("Keyboard %d - %s\n", device_id, desc.name); + SDL_GetDefaultKeymap(keymap); #if USE_MULTI_API SDL_SetKeymap(devdata->num_keyboard, 0, keymap, SDL_NUM_SCANCODES); @@ -701,8 +703,8 @@ EnumKeyboards(DFBInputDeviceID device_id, #endif devdata->num_keyboard++; - if (cb->sys_kbd) - return DFENUM_CANCEL; + if (cb->sys_kbd) + return DFENUM_CANCEL; } return DFENUM_OK; } @@ -711,15 +713,15 @@ void DirectFB_InitKeyboard(_THIS) { SDL_DFB_DEVICEDATA(_this); - cb_data cb; - + cb_data cb; + DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap)); devdata->num_keyboard = 0; cb.devdata = devdata; - + if (devdata->use_linux_input) { - cb.sys_kbd = 0; + cb.sys_kbd = 0; cb.sys_ids = 0; SDL_DFB_CHECK(devdata->dfb-> EnumInputDevices(devdata->dfb, EnumKeyboards, &cb)); @@ -730,7 +732,7 @@ DirectFB_InitKeyboard(_THIS) &cb)); } } else { - cb.sys_kbd = 1; + cb.sys_kbd = 1; SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb, EnumKeyboards, &cb)); @@ -740,7 +742,7 @@ DirectFB_InitKeyboard(_THIS) void DirectFB_QuitKeyboard(_THIS) { - //SDL_DFB_DEVICEDATA(_this); + /*SDL_DFB_DEVICEDATA(_this); */ SDL_KeyboardQuit(); diff --git a/src/video/directfb/SDL_DirectFB_modes.c b/src/video/directfb/SDL_DirectFB_modes.c index d3a7a54fa..c6d1bb49c 100644 --- a/src/video/directfb/SDL_DirectFB_modes.c +++ b/src/video/directfb/SDL_DirectFB_modes.c @@ -137,7 +137,7 @@ DirectFB_SetContext(_THIS, SDL_Window *window) SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; - /* FIXME: should we handle the error */ + /* FIXME: should we handle the error */ if (dispdata->vidIDinuse) SDL_DFB_CHECK(dispdata->vidlayer->SwitchContext(dispdata->vidlayer, DFB_TRUE)); @@ -220,7 +220,7 @@ DirectFB_InitModes(_THIS) SDL_DFB_CHECKERR(layer->GetConfiguration(layer, &dlc)); mode.format = DirectFB_DFBToSDLPixelFormat(dlc.pixelformat); - + if (mode.format == SDL_PIXELFORMAT_UNKNOWN) { SDL_DFB_ERR("Unknown dfb pixelformat %x !\n", dlc.pixelformat); goto error; @@ -309,7 +309,7 @@ DirectFB_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mod { /* * FIXME: video mode switch is currently broken for 1.2.0 - * + * */ SDL_DFB_DEVICEDATA(_this); diff --git a/src/video/directfb/SDL_DirectFB_modes.h b/src/video/directfb/SDL_DirectFB_modes.h index d9defec32..6e439cdc9 100644 --- a/src/video/directfb/SDL_DirectFB_modes.h +++ b/src/video/directfb/SDL_DirectFB_modes.h @@ -31,19 +31,19 @@ typedef struct _DFB_DisplayData DFB_DisplayData; struct _DFB_DisplayData { - IDirectFBDisplayLayer *layer; - DFBSurfacePixelFormat pixelformat; - /* FIXME: support for multiple video layer. - * However, I do not know any card supporting + IDirectFBDisplayLayer *layer; + DFBSurfacePixelFormat pixelformat; + /* FIXME: support for multiple video layer. + * However, I do not know any card supporting * more than one */ - DFBDisplayLayerID vidID; - IDirectFBDisplayLayer *vidlayer; + DFBDisplayLayerID vidID; + IDirectFBDisplayLayer *vidlayer; - int vidIDinuse; + int vidIDinuse; - int cw; - int ch; + int cw; + int ch; }; diff --git a/src/video/directfb/SDL_DirectFB_mouse.c b/src/video/directfb/SDL_DirectFB_mouse.c index 2377c877a..fb5ed4e7b 100644 --- a/src/video/directfb/SDL_DirectFB_mouse.c +++ b/src/video/directfb/SDL_DirectFB_mouse.c @@ -115,12 +115,12 @@ DirectFB_CreateDefaultCursor(void) { for (j = 0; j < 32; j++) { - switch (arrow[i][j]) - { - case ' ': dest[j] = 0x00000000; break; - case '.': dest[j] = 0xffffffff; break; - case 'X': dest[j] = 0xff000000; break; - } + switch (arrow[i][j]) + { + case ' ': dest[j] = 0x00000000; break; + case '.': dest[j] = 0xffffffff; break; + case 'X': dest[j] = 0xff000000; break; + } } dest += (pitch >> 2); } diff --git a/src/video/directfb/SDL_DirectFB_mouse.h b/src/video/directfb/SDL_DirectFB_mouse.h index b65f9fddb..906f1fb5e 100644 --- a/src/video/directfb/SDL_DirectFB_mouse.h +++ b/src/video/directfb/SDL_DirectFB_mouse.h @@ -30,8 +30,8 @@ typedef struct _DFB_CursorData DFB_CursorData; struct _DFB_CursorData { IDirectFBSurface *surf; - int hotx; - int hoty; + int hotx; + int hoty; }; #define SDL_DFB_CURSORDATA(curs) DFB_CursorData *curdata = (DFB_CursorData *) ((curs) ? (curs)->driverdata : NULL) diff --git a/src/video/directfb/SDL_DirectFB_opengl.c b/src/video/directfb/SDL_DirectFB_opengl.c index c325f4231..fac05e6f2 100644 --- a/src/video/directfb/SDL_DirectFB_opengl.c +++ b/src/video/directfb/SDL_DirectFB_opengl.c @@ -40,7 +40,7 @@ struct SDL_GLDriverData int gl_active; /* to stop switching drivers while we have a valid context */ int initialized; DirectFB_GLContext *firstgl; /* linked list */ - + /* OpenGL */ void (*glFinish) (void); void (*glFlush) (void); @@ -49,13 +49,13 @@ struct SDL_GLDriverData #define OPENGL_REQUIRS_DLOPEN #if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN) #include -#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL)) -#define GL_LoadFunction dlsym -#define GL_UnloadObject dlclose +#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL)) +#define GL_LoadFunction dlsym +#define GL_UnloadObject dlclose #else -#define GL_LoadObject SDL_LoadObject -#define GL_LoadFunction SDL_LoadFunction -#define GL_UnloadObject SDL_UnloadObject +#define GL_LoadObject SDL_LoadObject +#define GL_LoadFunction SDL_LoadFunction +#define GL_UnloadObject SDL_UnloadObject #endif static void DirectFB_GL_UnloadLibrary(_THIS); @@ -107,8 +107,6 @@ DirectFB_GL_Shutdown(_THIS) int DirectFB_GL_LoadLibrary(_THIS, const char *path) { - //SDL_DFB_DEVICEDATA(_this); - void *handle = NULL; SDL_DFB_DEBUG("Loadlibrary : %s\n", path); @@ -181,7 +179,6 @@ DirectFB_GL_GetProcAddress(_THIS, const char *proc) SDL_GLContext DirectFB_GL_CreateContext(_THIS, SDL_Window * window) { - //SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); DirectFB_GLContext *context; @@ -195,7 +192,7 @@ DirectFB_GL_CreateContext(_THIS, SDL_Window * window) context->is_locked = 0; context->sdl_window = window; - + context->next = _this->gl_data->firstgl; _this->gl_data->firstgl = context; @@ -215,7 +212,6 @@ DirectFB_GL_CreateContext(_THIS, SDL_Window * window) int DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { - //SDL_DFB_WINDOWDATA(window); DirectFB_GLContext *ctx = (DirectFB_GLContext *) context; DirectFB_GLContext *p; @@ -225,7 +221,7 @@ DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) SDL_DFB_CHECKERR(p->context->Unlock(p->context)); p->is_locked = 0; } - + } if (ctx != NULL) { @@ -253,7 +249,6 @@ DirectFB_GL_GetSwapInterval(_THIS) void DirectFB_GL_SwapWindow(_THIS, SDL_Window * window) { - //SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); DFBRegion region; DirectFB_GLContext *p; @@ -270,20 +265,14 @@ DirectFB_GL_SwapWindow(_THIS, SDL_Window * window) devdata->glFlush(); #endif - for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + for (p = _this->gl_data->firstgl; p != NULL; p = p->next) if (p->sdl_window == window && p->is_locked) { SDL_DFB_CHECKERR(p->context->Unlock(p->context)); p->is_locked = 0; - } + } SDL_DFB_CHECKERR(windata->window_surface->Flip(windata->window_surface,NULL, DSFLIP_PIPELINE |DSFLIP_BLIT | DSFLIP_ONSYNC )); - - //if (windata->gl_context) { - //SDL_DFB_CHECKERR(windata->surface->Flip(windata->surface,NULL, DSFLIP_ONSYNC)); - //SDL_DFB_CHECKERR(windata->gl_context->context->Lock(windata->gl_context->context)); - //} - return; error: return; @@ -313,14 +302,14 @@ void DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window) { DirectFB_GLContext *p; - - for (p = _this->gl_data->firstgl; p != NULL; p = p->next) - if (p->sdl_window == window) - { - if (p->is_locked) - SDL_DFB_CHECK(p->context->Unlock(p->context)); - SDL_DFB_RELEASE(p->context); - } + + for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + if (p->sdl_window == window) + { + if (p->is_locked) + SDL_DFB_CHECK(p->context->Unlock(p->context)); + SDL_DFB_RELEASE(p->context); + } } void @@ -328,15 +317,15 @@ DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window) { DirectFB_GLContext *p; - for (p = _this->gl_data->firstgl; p != NULL; p = p->next) - if (p->sdl_window == window) - { + for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + if (p->sdl_window == window) + { SDL_DFB_WINDOWDATA(window); - SDL_DFB_CHECK(windata->surface->GetGL(windata->surface, - &p->context)); - if (p->is_locked) - SDL_DFB_CHECK(p->context->Lock(p->context)); - } + SDL_DFB_CHECK(windata->surface->GetGL(windata->surface, + &p->context)); + if (p->is_locked) + SDL_DFB_CHECK(p->context->Lock(p->context)); + } } void @@ -344,9 +333,9 @@ DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window) { DirectFB_GLContext *p; - for (p = _this->gl_data->firstgl; p != NULL; p = p->next) - if (p->sdl_window == window) - DirectFB_GL_DeleteContext(_this, p); + for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + if (p->sdl_window == window) + DirectFB_GL_DeleteContext(_this, p); } #endif diff --git a/src/video/directfb/SDL_DirectFB_opengl.h b/src/video/directfb/SDL_DirectFB_opengl.h index 53d1572aa..efb11f766 100644 --- a/src/video/directfb/SDL_DirectFB_opengl.h +++ b/src/video/directfb/SDL_DirectFB_opengl.h @@ -32,11 +32,11 @@ typedef struct _DirectFB_GLContext DirectFB_GLContext; struct _DirectFB_GLContext { - IDirectFBGL *context; - DirectFB_GLContext *next; - - SDL_Window *sdl_window; - int is_locked; + IDirectFBGL *context; + DirectFB_GLContext *next; + + SDL_Window *sdl_window; + int is_locked; }; /* OpenGL functions */ diff --git a/src/video/directfb/SDL_DirectFB_render.c b/src/video/directfb/SDL_DirectFB_render.c index db69a5c44..958793db7 100644 --- a/src/video/directfb/SDL_DirectFB_render.c +++ b/src/video/directfb/SDL_DirectFB_render.c @@ -21,7 +21,6 @@ #include "SDL_config.h" #if SDL_VIDEO_DRIVER_DIRECTFB -//#include "SDL_DirectFB_video.h" #include "SDL_DirectFB_window.h" #include "SDL_DirectFB_modes.h" @@ -30,8 +29,6 @@ #include "../SDL_sysvideo.h" #include "../../render/SDL_sysrender.h" -//#include "../SDL_rect_c.h" -//#include "../SDL_yuv_sw_c.h" #ifndef DFB_VERSION_ATLEAST @@ -116,6 +113,7 @@ static int DirectFB_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * r static int DirectFB_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 format, const void * pixels, int pitch); static int DirectFB_UpdateViewport(SDL_Renderer * renderer); +static int DirectFB_UpdateClipRect(SDL_Renderer * renderer); static int DirectFB_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture); static int PrepareDraw(SDL_Renderer * renderer); @@ -241,7 +239,7 @@ SetBlendMode(DirectFB_RenderData * data, int blendMode, { IDirectFBSurface *destsurf = data->target; - //FIXME: check for format change + /* FIXME: check for format change */ if (1 || data->lastBlendMode != blendMode) { switch (blendMode) { case SDL_BLENDMODE_NONE: @@ -268,9 +266,9 @@ SetBlendMode(DirectFB_RenderData * data, int blendMode, case SDL_BLENDMODE_ADD: data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL; data->drawFlags = DSDRAW_BLEND; - // FIXME: SRCALPHA kills performance on radeon ... - // It will be cheaper to copy the surface to - // a temporay surface and premultiply + /* FIXME: SRCALPHA kills performance on radeon ... */ + * It will be cheaper to copy the surface to a temporary surface and premultiply + */ if (source && TextureHasAlpha(source)) SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA)); else @@ -280,9 +278,6 @@ SetBlendMode(DirectFB_RenderData * data, int blendMode, case SDL_BLENDMODE_MOD: data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL; data->drawFlags = DSDRAW_BLEND; - //SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DESTCOLOR)); - //SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO)); - //data->glBlendFunc(GL_ZERO, GL_SRC_COLOR); SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_ZERO)); SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_SRCCOLOR)); @@ -331,8 +326,8 @@ DirectFB_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) { /* Rebind the context to the window area and update matrices */ - //SDL_CurrentContext = NULL; - //data->updateSize = SDL_TRUE; + /*SDL_CurrentContext = NULL; */ + /*data->updateSize = SDL_TRUE; */ renddata->size_changed = SDL_TRUE; } } @@ -361,7 +356,6 @@ DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_Renderer *renderer = NULL; DirectFB_RenderData *data = NULL; DFBSurfaceCapabilities scaps; - //char *p; SDL_DFB_ALLOC_CLEAR(renderer, sizeof(*renderer)); SDL_DFB_ALLOC_CLEAR(data, sizeof(*data)); @@ -380,18 +374,17 @@ DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) /* SetDrawColor - no needed */ renderer->RenderFillRects = DirectFB_RenderFillRects; - /* RenderDrawEllipse - no reference implementation yet */ - /* RenderFillEllipse - no reference implementation yet */ renderer->RenderCopy = DirectFB_RenderCopy; renderer->RenderPresent = DirectFB_RenderPresent; /* FIXME: Yet to be tested */ renderer->RenderReadPixels = DirectFB_RenderReadPixels; - //renderer->RenderWritePixels = DirectFB_RenderWritePixels; + /*renderer->RenderWritePixels = DirectFB_RenderWritePixels; */ renderer->DestroyTexture = DirectFB_DestroyTexture; renderer->DestroyRenderer = DirectFB_DestroyRenderer; renderer->UpdateViewport = DirectFB_UpdateViewport; + renderer->UpdateClipRect = DirectFB_UpdateClipRect; renderer->SetRenderTarget = DirectFB_SetRenderTarget; #if 0 @@ -458,7 +451,6 @@ DirectFB_ActivateRenderer(SDL_Renderer * renderer) SDL_DFB_WINDOWDATA(window); if (renddata->size_changed /*|| windata->wm_needs_redraw*/) { - //DirectFB_AdjustWindowSurface(window); renddata->size_changed = SDL_FALSE; } } @@ -467,7 +459,6 @@ DirectFB_ActivateRenderer(SDL_Renderer * renderer) static int DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture) { - //SDL_DFB_RENDERERDATA(renderer); SDL_Window *window = renderer->window; SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_DFB_DEVICEDATA(display->device); @@ -586,7 +577,7 @@ DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) * Creating a new palette does not help. */ DFBPaletteDescription pal_desc; - pal_desc.flags = DPDESC_SIZE; // | DPDESC_ENTRIES + pal_desc.flags = DPDESC_SIZE; /* | DPDESC_ENTRIES */ pal_desc.size = 256; SDL_DFB_CHECKERR(devdata->dfb->CreatePalette(devdata->dfb, &pal_desc,&data->palette)); SDL_DFB_CHECKERR(data->surface->SetPalette(data->surface, data->palette)); @@ -710,7 +701,7 @@ DirectFB_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture) { switch (texture->blendMode) { case SDL_BLENDMODE_NONE: - //case SDL_BLENDMODE_MASK: + /*case SDL_BLENDMODE_MASK: */ case SDL_BLENDMODE_BLEND: case SDL_BLENDMODE_ADD: case SDL_BLENDMODE_MOD: @@ -726,7 +717,7 @@ DirectFB_SetDrawBlendMode(SDL_Renderer * renderer) { switch (renderer->blendMode) { case SDL_BLENDMODE_NONE: - //case SDL_BLENDMODE_MASK: + /*case SDL_BLENDMODE_MASK: */ case SDL_BLENDMODE_BLEND: case SDL_BLENDMODE_ADD: case SDL_BLENDMODE_MOD: @@ -778,7 +769,7 @@ DirectFB_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, int row; size_t length; int bpp = DFB_BYTES_PER_PIXEL(DirectFB_SDLToDFBPixelFormat(texture->format)); - // FIXME: SDL_BYTESPERPIXEL(texture->format) broken for yuv yv12 3 planes + /* FIXME: SDL_BYTESPERPIXEL(texture->format) broken for yuv yv12 3 planes */ DirectFB_ActivateRenderer(renderer); @@ -925,7 +916,7 @@ PrepareDraw(SDL_Renderer * renderer) switch (renderer->blendMode) { case SDL_BLENDMODE_NONE: - //case SDL_BLENDMODE_MASK: + /*case SDL_BLENDMODE_MASK: */ case SDL_BLENDMODE_BLEND: break; case SDL_BLENDMODE_ADD: @@ -1035,7 +1026,7 @@ DirectFB_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, int c destsurf->GetClip(destsurf, &clip_region); for (i=0; iFillRectangle(destsurf, dst.x, dst.y, @@ -1137,7 +1128,7 @@ DirectFB_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, SDL_DFB_CHECKERR(destsurf-> SetColor(destsurf, r, g, b, alpha)); - // ???? flags |= DSBLIT_SRC_PREMULTCOLOR; + /* ???? flags |= DSBLIT_SRC_PREMULTCOLOR; */ SetBlendMode(data, texture->blendMode, texturedata); @@ -1208,7 +1199,6 @@ DirectFB_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (!data) { return; } - //SDL_FreeDirtyRects(&data->dirty); SDL_DFB_RELEASE(data->palette); SDL_DFB_RELEASE(data->surface); if (data->display) { @@ -1258,6 +1248,28 @@ DirectFB_UpdateViewport(SDL_Renderer * renderer) return 0; } +static int +DirectFB_UpdateClipRect(SDL_Renderer * renderer) +{ + const SDL_Rect *rect = &renderer->clip_rect; + DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; + IDirectFBSurface *destsurf = get_dfb_surface(data->window); + DFBRegion region; + + if (!SDL_RectEmpty(rect)) { + region.x1 = rect->x; + region.x2 = rect->x + rect->w; + region.y1 = rect->y; + region.y2 = rect->y + rect->h; + SDL_DFB_CHECKERR(destsurf->SetClip(destsurf, ®ion)); + } else { + SDL_DFB_CHECKERR(destsurf->SetClip(destsurf, NULL)); + } + return 0; + error: + return -1; +} + static int DirectFB_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 format, void * pixels, int pitch) diff --git a/src/video/directfb/SDL_DirectFB_shape.c b/src/video/directfb/SDL_DirectFB_shape.c index 01ac74449..13c3d703e 100644 --- a/src/video/directfb/SDL_DirectFB_shape.c +++ b/src/video/directfb/SDL_DirectFB_shape.c @@ -57,20 +57,20 @@ int DirectFB_ResizeWindowShape(SDL_Window* window) { SDL_ShapeData* data = window->shaper->driverdata; SDL_assert(data != NULL); - - if (window->x != -1000) + + if (window->x != -1000) { - window->shaper->userx = window->x; - window->shaper->usery = window->y; + window->shaper->userx = window->x; + window->shaper->usery = window->y; } SDL_SetWindowPosition(window,-1000,-1000); - + return 0; } - + int DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) { - + if(shaper == NULL || shape == NULL || shaper->driverdata == NULL) return -1; if(shape->format->Amask == 0 && SDL_SHAPEMODEALPHA(shape_mode->mode)) @@ -81,10 +81,10 @@ DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowSh { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(shaper->window); SDL_DFB_DEVICEDATA(display->device); - Uint32 *pixels; - Sint32 pitch; - Uint32 h,w; - Uint8 *src, *bitmap; + Uint32 *pixels; + Sint32 pitch; + Uint32 h,w; + Uint8 *src, *bitmap; DFBSurfaceDescription dsc; SDL_ShapeData *data = shaper->driverdata; @@ -103,32 +103,32 @@ DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowSh SDL_DFB_ALLOC_CLEAR(bitmap, shape->w * shape->h); SDL_CalculateShapeBitmap(shaper->mode,shape,bitmap,1); - src = bitmap; + src = bitmap; SDL_DFB_CHECK(data->surface->Lock(data->surface, DSLF_WRITE | DSLF_READ, (void **) &pixels, &pitch)); - h = shaper->window->h; - while (h--) { - for (w = 0; w < shaper->window->w; w++) { - if (*src) - pixels[w] = 0xFFFFFFFF; - else - pixels[w] = 0; - src++; + h = shaper->window->h; + while (h--) { + for (w = 0; w < shaper->window->w; w++) { + if (*src) + pixels[w] = 0xFFFFFFFF; + else + pixels[w] = 0; + src++; - } - pixels += (pitch >> 2); - } + } + pixels += (pitch >> 2); + } SDL_DFB_CHECK(data->surface->Unlock(data->surface)); - SDL_DFB_FREE(bitmap); + SDL_DFB_FREE(bitmap); - /* FIXME: Need to call this here - Big ?? */ - DirectFB_WM_RedrawLayout(SDL_GetDisplayForWindow(shaper->window)->device, shaper->window); + /* FIXME: Need to call this here - Big ?? */ + DirectFB_WM_RedrawLayout(SDL_GetDisplayForWindow(shaper->window)->device, shaper->window); } - + return 0; error: - return -1; + return -1; } #endif /* SDL_VIDEO_DRIVER_DIRECTFB */ diff --git a/src/video/directfb/SDL_DirectFB_shape.h b/src/video/directfb/SDL_DirectFB_shape.h index b405bdea2..a99778533 100644 --- a/src/video/directfb/SDL_DirectFB_shape.h +++ b/src/video/directfb/SDL_DirectFB_shape.h @@ -28,12 +28,12 @@ #include "SDL_shape.h" typedef struct { - IDirectFBSurface *surface; + IDirectFBSurface *surface; } SDL_ShapeData; extern SDL_Window* DirectFB_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); extern SDL_WindowShaper* DirectFB_CreateShaper(SDL_Window* window); extern int DirectFB_ResizeWindowShape(SDL_Window* window); -extern int DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode); +extern int DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode); #endif /* _SDL_DirectFB_shape_h */ diff --git a/src/video/directfb/SDL_DirectFB_video.c b/src/video/directfb/SDL_DirectFB_video.c index 3f9bba2ba..d20b5f122 100644 --- a/src/video/directfb/SDL_DirectFB_video.c +++ b/src/video/directfb/SDL_DirectFB_video.c @@ -148,13 +148,13 @@ DirectFB_CreateDevice(int devindex) #endif - /* Shaped window support */ - device->shape_driver.CreateShaper = DirectFB_CreateShaper; - device->shape_driver.SetWindowShape = DirectFB_SetWindowShape; - device->shape_driver.ResizeWindowShape = DirectFB_ResizeWindowShape; - + /* Shaped window support */ + device->shape_driver.CreateShaper = DirectFB_CreateShaper; + device->shape_driver.SetWindowShape = DirectFB_SetWindowShape; + device->shape_driver.ResizeWindowShape = DirectFB_ResizeWindowShape; + device->free = DirectFB_DeleteDevice; - + return device; error: if (device) @@ -235,19 +235,19 @@ DirectFB_VideoInit(_THIS) DirectFBSetOption("disable-module", "x11input"); } - /* FIXME: Reenable as default once multi kbd/mouse interface is sorted out */ - devdata->use_linux_input = readBoolEnv(DFBENV_USE_LINUX_INPUT, 0); /* default: on */ + /* FIXME: Reenable as default once multi kbd/mouse interface is sorted out */ + devdata->use_linux_input = readBoolEnv(DFBENV_USE_LINUX_INPUT, 0); /* default: on */ if (!devdata->use_linux_input) { - SDL_DFB_LOG("Disabling linxu input\n"); + SDL_DFB_LOG("Disabling linxu input\n"); DirectFBSetOption("disable-module", "linux_input"); } - + SDL_DFB_CHECKERR(DirectFBCreate(&dfb)); DirectFB_DeviceInformation(dfb); - + devdata->use_yuv_underlays = readBoolEnv(DFBENV_USE_YUV_UNDERLAY, 0); /* default: off */ devdata->use_yuv_direct = readBoolEnv(DFBENV_USE_YUV_DIRECT, 0); /* default is off! */ @@ -317,7 +317,7 @@ DirectFB_VideoQuit(_THIS) static const struct { DFBSurfacePixelFormat dfb; Uint32 sdl; -} pixelformat_tab[] = +} pixelformat_tab[] = { { DSPF_RGB32, SDL_PIXELFORMAT_RGB888 }, /* 24 bit RGB (4 byte, nothing@24, red 8@16, green 8@8, blue 8@0) */ { DSPF_ARGB, SDL_PIXELFORMAT_ARGB8888 }, /* 32 bit ARGB (4 byte, alpha 8@24, red 8@16, green 8@8, blue 8@0) */ @@ -342,38 +342,38 @@ static const struct { { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR555 }, #endif - /* Pfff ... nonmatching formats follow */ - + /* Pfff ... nonmatching formats follow */ + { DSPF_ALUT44, SDL_PIXELFORMAT_UNKNOWN }, /* 8 bit ALUT (1 byte, alpha 4@4, color lookup 4@0) */ - { DSPF_A8, SDL_PIXELFORMAT_UNKNOWN }, /* 8 bit alpha (1 byte, alpha 8@0), e.g. anti-aliased glyphs */ - { DSPF_AiRGB, SDL_PIXELFORMAT_UNKNOWN }, /* 32 bit ARGB (4 byte, inv. alpha 8@24, red 8@16, green 8@8, blue 8@0) */ - { DSPF_A1, SDL_PIXELFORMAT_UNKNOWN }, /* 1 bit alpha (1 byte/ 8 pixel, most significant bit used first) */ - { DSPF_NV12, SDL_PIXELFORMAT_UNKNOWN }, /* 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane) */ - { DSPF_NV16, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit YUV (8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane) */ - { DSPF_ARGB2554, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit ARGB (2 byte, alpha 2@14, red 5@9, green 5@4, blue 4@0) */ - { DSPF_NV21, SDL_PIXELFORMAT_UNKNOWN }, /* 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CrCb [15:0] plane) */ - { DSPF_AYUV, SDL_PIXELFORMAT_UNKNOWN }, /* 32 bit AYUV (4 byte, alpha 8@24, Y 8@16, Cb 8@8, Cr 8@0) */ - { DSPF_A4, SDL_PIXELFORMAT_UNKNOWN }, /* 4 bit alpha (1 byte/ 2 pixel, more significant nibble used first) */ - { DSPF_ARGB1666, SDL_PIXELFORMAT_UNKNOWN }, /* 1 bit alpha (3 byte/ alpha 1@18, red 6@16, green 6@6, blue 6@0) */ - { DSPF_ARGB6666, SDL_PIXELFORMAT_UNKNOWN }, /* 6 bit alpha (3 byte/ alpha 6@18, red 6@16, green 6@6, blue 6@0) */ - { DSPF_RGB18, SDL_PIXELFORMAT_UNKNOWN }, /* 6 bit RGB (3 byte/ red 6@16, green 6@6, blue 6@0) */ - { DSPF_LUT2, SDL_PIXELFORMAT_UNKNOWN }, /* 2 bit LUT (1 byte/ 4 pixel, 2 bit color and alpha lookup from palette) */ + { DSPF_A8, SDL_PIXELFORMAT_UNKNOWN }, /* 8 bit alpha (1 byte, alpha 8@0), e.g. anti-aliased glyphs */ + { DSPF_AiRGB, SDL_PIXELFORMAT_UNKNOWN }, /* 32 bit ARGB (4 byte, inv. alpha 8@24, red 8@16, green 8@8, blue 8@0) */ + { DSPF_A1, SDL_PIXELFORMAT_UNKNOWN }, /* 1 bit alpha (1 byte/ 8 pixel, most significant bit used first) */ + { DSPF_NV12, SDL_PIXELFORMAT_UNKNOWN }, /* 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane) */ + { DSPF_NV16, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit YUV (8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane) */ + { DSPF_ARGB2554, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit ARGB (2 byte, alpha 2@14, red 5@9, green 5@4, blue 4@0) */ + { DSPF_NV21, SDL_PIXELFORMAT_UNKNOWN }, /* 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CrCb [15:0] plane) */ + { DSPF_AYUV, SDL_PIXELFORMAT_UNKNOWN }, /* 32 bit AYUV (4 byte, alpha 8@24, Y 8@16, Cb 8@8, Cr 8@0) */ + { DSPF_A4, SDL_PIXELFORMAT_UNKNOWN }, /* 4 bit alpha (1 byte/ 2 pixel, more significant nibble used first) */ + { DSPF_ARGB1666, SDL_PIXELFORMAT_UNKNOWN }, /* 1 bit alpha (3 byte/ alpha 1@18, red 6@16, green 6@6, blue 6@0) */ + { DSPF_ARGB6666, SDL_PIXELFORMAT_UNKNOWN }, /* 6 bit alpha (3 byte/ alpha 6@18, red 6@16, green 6@6, blue 6@0) */ + { DSPF_RGB18, SDL_PIXELFORMAT_UNKNOWN }, /* 6 bit RGB (3 byte/ red 6@16, green 6@6, blue 6@0) */ + { DSPF_LUT2, SDL_PIXELFORMAT_UNKNOWN }, /* 2 bit LUT (1 byte/ 4 pixel, 2 bit color and alpha lookup from palette) */ #if (DFB_VERSION_ATLEAST(1,3,0)) - { DSPF_RGBA4444, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit RGBA (2 byte, red 4@12, green 4@8, blue 4@4, alpha 4@0) */ + { DSPF_RGBA4444, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit RGBA (2 byte, red 4@12, green 4@8, blue 4@4, alpha 4@0) */ #endif #if (DFB_VERSION_ATLEAST(1,4,3)) - { DSPF_RGBA5551, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit RGBA (2 byte, red 5@11, green 5@6, blue 5@1, alpha 1@0) */ - { DSPF_YUV444P, SDL_PIXELFORMAT_UNKNOWN }, /* 24 bit full YUV planar (8 bit Y plane followed by an 8 bit Cb and an 8 bit Cr plane) */ - { DSPF_ARGB8565, SDL_PIXELFORMAT_UNKNOWN }, /* 24 bit ARGB (3 byte, alpha 8@16, red 5@11, green 6@5, blue 5@0) */ - { DSPF_AVYU, SDL_PIXELFORMAT_UNKNOWN }, /* 32 bit AVYU 4:4:4 (4 byte, alpha 8@24, Cr 8@16, Y 8@8, Cb 8@0) */ - { DSPF_VYU, SDL_PIXELFORMAT_UNKNOWN }, /* 24 bit VYU 4:4:4 (3 byte, Cr 8@16, Y 8@8, Cb 8@0) */ + { DSPF_RGBA5551, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit RGBA (2 byte, red 5@11, green 5@6, blue 5@1, alpha 1@0) */ + { DSPF_YUV444P, SDL_PIXELFORMAT_UNKNOWN }, /* 24 bit full YUV planar (8 bit Y plane followed by an 8 bit Cb and an 8 bit Cr plane) */ + { DSPF_ARGB8565, SDL_PIXELFORMAT_UNKNOWN }, /* 24 bit ARGB (3 byte, alpha 8@16, red 5@11, green 6@5, blue 5@0) */ + { DSPF_AVYU, SDL_PIXELFORMAT_UNKNOWN }, /* 32 bit AVYU 4:4:4 (4 byte, alpha 8@24, Cr 8@16, Y 8@8, Cb 8@0) */ + { DSPF_VYU, SDL_PIXELFORMAT_UNKNOWN }, /* 24 bit VYU 4:4:4 (3 byte, Cr 8@16, Y 8@8, Cb 8@0) */ #endif - + { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX1LSB }, { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX1MSB }, - { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX4LSB }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX4LSB }, { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX4MSB }, { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR24 }, { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR888 }, @@ -384,14 +384,14 @@ static const struct { { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR4444 }, { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR1555 }, { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR565 }, - { DSPF_UNKNOWN, SDL_PIXELFORMAT_YVYU }, /**< Packed mode: Y0+V0+Y1+U0 (1 pla */ + { DSPF_UNKNOWN, SDL_PIXELFORMAT_YVYU }, /**< Packed mode: Y0+V0+Y1+U0 (1 pla */ }; Uint32 DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat) { int i; - + for (i=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++) if (pixelformat_tab[i].dfb == pixelformat) { @@ -404,7 +404,7 @@ DFBSurfacePixelFormat DirectFB_SDLToDFBPixelFormat(Uint32 format) { int i; - + for (i=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++) if (pixelformat_tab[i].sdl == format) { @@ -415,11 +415,11 @@ DirectFB_SDLToDFBPixelFormat(Uint32 format) void DirectFB_SetSupportedPixelFormats(SDL_RendererInfo* ri) { - int i, j; + int i, j; for (i=0, j=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++) - if (pixelformat_tab[i].sdl != SDL_PIXELFORMAT_UNKNOWN) - ri->texture_formats[j++] = pixelformat_tab[i].sdl; + if (pixelformat_tab[i].sdl != SDL_PIXELFORMAT_UNKNOWN) + ri->texture_formats[j++] = pixelformat_tab[i].sdl; ri->num_texture_formats = j; } diff --git a/src/video/directfb/SDL_DirectFB_video.h b/src/video/directfb/SDL_DirectFB_video.h index 4980f7a5c..53fcdcfb9 100644 --- a/src/video/directfb/SDL_DirectFB_video.h +++ b/src/video/directfb/SDL_DirectFB_video.h @@ -33,14 +33,14 @@ #include "SDL_log.h" -#define DFB_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) +#define DFB_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) #define DFB_COMPILEDVERSION \ - DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION) + DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION) #define DFB_VERSION_ATLEAST(X, Y, Z) \ - (DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z)) + (DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z)) #if (DFB_VERSION_ATLEAST(1,0,0)) #ifdef SDL_VIDEO_OPENGL @@ -51,10 +51,10 @@ #endif /* Set below to 1 to compile with (old) multi mice/keyboard api. Code left in - * in case we see this again ... + * in case we see this again ... */ -#define USE_MULTI_API (0) +#define USE_MULTI_API (0) /* Support for LUT8/INDEX8 pixel format. * This is broken in DirectFB 1.4.3. It works in 1.4.0 and 1.4.5 @@ -62,18 +62,18 @@ */ #if (DFB_COMPILEDVERSION == DFB_VERSIONNUM(1, 4, 3)) -#define ENABLE_LUT8 (0) +#define ENABLE_LUT8 (0) #else -#define ENABLE_LUT8 (1) +#define ENABLE_LUT8 (1) #endif #define DIRECTFB_DEBUG 1 -#define DFBENV_USE_YUV_UNDERLAY "SDL_DIRECTFB_YUV_UNDERLAY" /* Default: off */ -#define DFBENV_USE_YUV_DIRECT "SDL_DIRECTFB_YUV_DIRECT" /* Default: off */ -#define DFBENV_USE_X11_CHECK "SDL_DIRECTFB_X11_CHECK" /* Default: on */ -#define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */ -#define DFBENV_USE_WM "SDL_DIRECTFB_WM" /* Default: off */ +#define DFBENV_USE_YUV_UNDERLAY "SDL_DIRECTFB_YUV_UNDERLAY" /* Default: off */ +#define DFBENV_USE_YUV_DIRECT "SDL_DIRECTFB_YUV_DIRECT" /* Default: off */ +#define DFBENV_USE_X11_CHECK "SDL_DIRECTFB_X11_CHECK" /* Default: on */ +#define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */ +#define DFBENV_USE_WM "SDL_DIRECTFB_WM" /* Default: off */ #define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { SDL_DFB_CHECK(x->Release(x)); x = NULL; } } while (0) #define SDL_DFB_FREE(x) do { if ( (x) != NULL ) { SDL_free(x); x = NULL; } } while (0) @@ -89,11 +89,11 @@ #define SDL_DFB_DEBUG(x...) SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, x) static inline DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int src_line) { - if (ret != DFB_OK) { - SDL_DFB_LOG("%s (%d):%s", src_file, src_line, DirectFBErrorString (ret) ); - SDL_SetError("%s:%s", SDL_DFB_CONTEXT, DirectFBErrorString (ret) ); - } - return ret; + if (ret != DFB_OK) { + SDL_DFB_LOG("%s (%d):%s", src_file, src_line, DirectFBErrorString (ret) ); + SDL_SetError("%s:%s", SDL_DFB_CONTEXT, DirectFBErrorString (ret) ); + } + return ret; } #define SDL_DFB_CHECK(x...) do { sdl_dfb_check( x, __FILE__, __LINE__); } while (0) @@ -113,9 +113,9 @@ static inline DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int s do { \ r = SDL_calloc (n, s); \ if (!(r)) { \ - SDL_DFB_ERR("Out of memory"); \ + SDL_DFB_ERR("Out of memory"); \ SDL_OutOfMemory(); \ - goto error; \ + goto error; \ } \ } while (0) @@ -130,10 +130,10 @@ static inline DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int s typedef struct _DFB_KeyboardData DFB_KeyboardData; struct _DFB_KeyboardData { - const SDL_Scancode *map; /* keyboard scancode map */ - int map_size; /* size of map */ - int map_adjust; /* index adjust */ - int is_generic; /* generic keyboard */ + const SDL_Scancode *map; /* keyboard scancode map */ + int map_size; /* size of map */ + int map_adjust; /* index adjust */ + int is_generic; /* generic keyboard */ int id; }; @@ -142,21 +142,21 @@ struct _DFB_DeviceData { int initialized; - IDirectFB *dfb; - int num_mice; - int mouse_id[0x100]; - int num_keyboard; - DFB_KeyboardData keyboard[10]; - SDL_Window *firstwin; + IDirectFB *dfb; + int num_mice; + int mouse_id[0x100]; + int num_keyboard; + DFB_KeyboardData keyboard[10]; + SDL_Window *firstwin; - int use_yuv_underlays; - int use_yuv_direct; - int use_linux_input; - int has_own_wm; + int use_yuv_underlays; + int use_yuv_direct; + int use_linux_input; + int has_own_wm; - /* window grab */ - SDL_Window *grabbed_window; + /* window grab */ + SDL_Window *grabbed_window; /* global events */ IDirectFBEventBuffer *events; diff --git a/src/video/directfb/SDL_DirectFB_window.c b/src/video/directfb/SDL_DirectFB_window.c index 1ba4cfe60..cdcb4cce6 100644 --- a/src/video/directfb/SDL_DirectFB_window.c +++ b/src/video/directfb/SDL_DirectFB_window.c @@ -57,10 +57,10 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) SDL_DFB_CHECKERR(dispdata->layer->SetCooperativeLevel(dispdata->layer, DLSCL_ADMINISTRATIVE)); #endif - /* FIXME ... ughh, ugly */ - if (window->x == -1000 && window->y == -1000) - bshaped = 1; - + /* FIXME ... ughh, ugly */ + if (window->x == -1000 && window->y == -1000) + bshaped = 1; + /* Fill the window description. */ x = window->x; y = window->y; @@ -68,21 +68,21 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h); /* Create Window */ - desc.caps = 0; + desc.caps = 0; desc.flags = DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY | DWDESC_SURFACE_CAPS; if (bshaped) { - desc.flags |= DWDESC_CAPS; - desc.caps |= DWCAPS_ALPHACHANNEL; + desc.flags |= DWDESC_CAPS; + desc.caps |= DWCAPS_ALPHACHANNEL; } else { - desc.flags |= DWDESC_PIXELFORMAT; + desc.flags |= DWDESC_PIXELFORMAT; } if (!(window->flags & SDL_WINDOW_BORDERLESS)) - desc.caps |= DWCAPS_NODECORATION; + desc.caps |= DWCAPS_NODECORATION; desc.posx = x; desc.posy = y; @@ -116,7 +116,7 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) wopts |= DWOP_KEEP_POSITION | DWOP_KEEP_STACKING | DWOP_KEEP_SIZE; SDL_DFB_CHECK(windata->dfbwin->SetStackingClass(windata->dfbwin, DWSC_UPPER)); } - + if (bshaped) { wopts |= DWOP_SHAPED | DWOP_ALPHACHANNEL; wopts &= ~DWOP_OPAQUE_REGION; @@ -155,7 +155,7 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) SDL_DFB_CHECK(windata->dfbwin->RaiseToTop(windata->dfbwin)); /* remember parent */ - //windata->sdlwin = window; + /*windata->sdlwin = window; */ /* Add to list ... */ @@ -168,7 +168,7 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) return 0; error: - SDL_DFB_RELEASE(windata->surface); + SDL_DFB_RELEASE(windata->surface); SDL_DFB_RELEASE(windata->dfbwin); return -1; } @@ -275,7 +275,7 @@ DirectFB_SetWindowSize(_THIS, SDL_Window * window) if (cw != window->w || ch != window->h) { - DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h); + DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h); SDL_DFB_CHECKERR(windata->dfbwin->Resize(windata->dfbwin, windata->size.w, windata->size.h)); @@ -367,7 +367,7 @@ DirectFB_RestoreWindow(_THIS, SDL_Window * window) /* Window layout */ DirectFB_WM_AdjustWindowLayout(window, window->flags & ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED), - windata->restore.w, windata->restore.h); + windata->restore.w, windata->restore.h); SDL_DFB_CHECK(windata->dfbwin->Resize(windata->dfbwin, windata->restore.w, windata->restore.h)); SDL_DFB_CHECK(windata->dfbwin->MoveTo(windata->dfbwin, windata->restore.x, @@ -393,8 +393,8 @@ DirectFB_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) if ((window->flags & SDL_WINDOW_INPUT_GRABBED)) { if (gwindata != NULL) { - SDL_DFB_CHECK(gwindata->dfbwin->UngrabPointer(gwindata->dfbwin)); - SDL_DFB_CHECK(gwindata->dfbwin->UngrabKeyboard(gwindata->dfbwin)); + SDL_DFB_CHECK(gwindata->dfbwin->UngrabPointer(gwindata->dfbwin)); + SDL_DFB_CHECK(gwindata->dfbwin->UngrabKeyboard(gwindata->dfbwin)); } SDL_DFB_CHECK(windata->dfbwin->GrabPointer(windata->dfbwin)); SDL_DFB_CHECK(windata->dfbwin->GrabKeyboard(windata->dfbwin)); @@ -418,22 +418,22 @@ DirectFB_DestroyWindow(_THIS, SDL_Window * window) SDL_DFB_CHECK(windata->dfbwin->UngrabKeyboard(windata->dfbwin)); #if SDL_DIRECTFB_OPENGL - DirectFB_GL_DestroyWindowContexts(_this, window); + DirectFB_GL_DestroyWindowContexts(_this, window); #endif - if (window->shaper) - { - SDL_ShapeData *data = window->shaper->driverdata; - SDL_DFB_CHECK(data->surface->ReleaseSource(data->surface)); - SDL_DFB_RELEASE(data->surface); - SDL_DFB_FREE(data); - SDL_DFB_FREE(window->shaper); - } + if (window->shaper) + { + SDL_ShapeData *data = window->shaper->driverdata; + SDL_DFB_CHECK(data->surface->ReleaseSource(data->surface)); + SDL_DFB_RELEASE(data->surface); + SDL_DFB_FREE(data); + SDL_DFB_FREE(window->shaper); + } SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, NULL)); SDL_DFB_CHECK(windata->surface->ReleaseSource(windata->surface)); SDL_DFB_CHECK(windata->window_surface->ReleaseSource(windata->window_surface)); - SDL_DFB_RELEASE(windata->icon); + SDL_DFB_RELEASE(windata->icon); SDL_DFB_RELEASE(windata->font); SDL_DFB_RELEASE(windata->eventbuffer); SDL_DFB_RELEASE(windata->surface); @@ -494,7 +494,7 @@ DirectFB_AdjustWindowSurface(SDL_Window * window) if (adjust) { #if SDL_DIRECTFB_OPENGL - DirectFB_GL_FreeWindowContexts(SDL_GetVideoDevice(), window); + DirectFB_GL_FreeWindowContexts(SDL_GetVideoDevice(), window); #endif #if (DFB_VERSION_ATLEAST(1,2,1)) @@ -521,9 +521,9 @@ DirectFB_AdjustWindowSurface(SDL_Window * window) &windata->client, &windata->surface)); #endif DirectFB_WM_RedrawLayout(SDL_GetVideoDevice(), window); - + #if SDL_DIRECTFB_OPENGL - DirectFB_GL_ReAllocWindowContexts(SDL_GetVideoDevice(), window); + DirectFB_GL_ReAllocWindowContexts(SDL_GetVideoDevice(), window); #endif } error: diff --git a/src/video/directfb/SDL_DirectFB_window.h b/src/video/directfb/SDL_DirectFB_window.h index 43a08d308..a4a1cc840 100644 --- a/src/video/directfb/SDL_DirectFB_window.h +++ b/src/video/directfb/SDL_DirectFB_window.h @@ -30,28 +30,28 @@ typedef struct _DFB_WindowData DFB_WindowData; struct _DFB_WindowData { - IDirectFBSurface *window_surface; /* window surface */ - IDirectFBSurface *surface; /* client drawing surface */ - IDirectFBWindow *dfbwin; - IDirectFBEventBuffer *eventbuffer; - //SDL_Window *sdlwin; - SDL_Window *next; - Uint8 opacity; - DFBRectangle client; - DFBDimension size; - DFBRectangle restore; + IDirectFBSurface *window_surface; /* window surface */ + IDirectFBSurface *surface; /* client drawing surface */ + IDirectFBWindow *dfbwin; + IDirectFBEventBuffer *eventbuffer; + /*SDL_Window *sdlwin; */ + SDL_Window *next; + Uint8 opacity; + DFBRectangle client; + DFBDimension size; + DFBRectangle restore; /* WM extras */ - int is_managed; - int wm_needs_redraw; - IDirectFBSurface *icon; - IDirectFBFont *font; - DFB_Theme theme; + int is_managed; + int wm_needs_redraw; + IDirectFBSurface *icon; + IDirectFBFont *font; + DFB_Theme theme; /* WM moving and sizing */ - int wm_grab; - int wm_lastx; - int wm_lasty; + int wm_grab; + int wm_lastx; + int wm_lasty; }; extern int DirectFB_CreateWindow(_THIS, SDL_Window * window); diff --git a/src/video/pandora/SDL_pandora.c b/src/video/pandora/SDL_pandora.c index 77d12b79c..1ebf82952 100644 --- a/src/video/pandora/SDL_pandora.c +++ b/src/video/pandora/SDL_pandora.c @@ -38,7 +38,7 @@ /* WIZ declarations */ #include "GLES/gl.h" #ifdef WIZ_GLES_LITE -static NativeWindowType hNativeWnd = 0; // A handle to the window we will create. +static NativeWindowType hNativeWnd = 0; /* A handle to the window we will create. */ #endif static SDL_bool PND_initialized = SDL_FALSE; @@ -294,8 +294,6 @@ PND_restorewindow(_THIS, SDL_Window * window) void PND_setwindowgrab(_THIS, SDL_Window * window) { - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - eglTerminate(phdata->egl_display); } void PND_destroywindow(_THIS, SDL_Window * window) @@ -343,7 +341,7 @@ PND_gl_loadlibrary(_THIS, const char *path) /* Already linked with GF library which provides egl* subset of */ /* functions, use Common profile of OpenGL ES library by default */ #ifdef WIZ_GLES_LITE - path = "/lib/libopengles_lite.so"; + path = "/lib/libopengles_lite.so"; #else path = "/usr/lib/libGLES_CM.so"; #endif @@ -628,21 +626,21 @@ PND_gl_createcontext(_THIS, SDL_Window * window) #ifdef WIZ_GLES_LITE if( !hNativeWnd ) { - hNativeWnd = (NativeWindowType)malloc(16*1024); + hNativeWnd = (NativeWindowType)malloc(16*1024); - if(!hNativeWnd) - printf( "Error : Wiz framebuffer allocatation failed\n" ); - else - printf( "SDL13: Wiz framebuffer allocated: %X\n", hNativeWnd ); + if(!hNativeWnd) + printf( "Error : Wiz framebuffer allocatation failed\n" ); + else + printf( "SDL13: Wiz framebuffer allocated: %X\n", hNativeWnd ); } else { - printf( "SDL13: Wiz framebuffer already allocated: %X\n", hNativeWnd ); + printf( "SDL13: Wiz framebuffer already allocated: %X\n", hNativeWnd ); } wdata->gles_surface = - eglCreateWindowSurface(phdata->egl_display, - wdata->gles_configs[wdata->gles_config], - hNativeWnd, NULL ); + eglCreateWindowSurface(phdata->egl_display, + wdata->gles_configs[wdata->gles_config], + hNativeWnd, NULL ); #else wdata->gles_surface = eglCreateWindowSurface(phdata->egl_display, @@ -838,9 +836,9 @@ PND_gl_deletecontext(_THIS, SDL_GLContext context) #ifdef WIZ_GLES_LITE if( hNativeWnd != 0 ) { - free(hNativeWnd); - hNativeWnd = 0; - printf( "SDL13: Wiz framebuffer released\n" ); + free(hNativeWnd); + hNativeWnd = 0; + printf( "SDL13: Wiz framebuffer released\n" ); } #endif diff --git a/src/video/psp/SDL_pspevents.c b/src/video/psp/SDL_pspevents.c index e418daae2..54cd4e7d8 100644 --- a/src/video/psp/SDL_pspevents.c +++ b/src/video/psp/SDL_pspevents.c @@ -47,236 +47,236 @@ static SDL_sem *event_sem = NULL; static SDL_Thread *thread = NULL; static int running = 0; static struct { - enum PspHprmKeys id; - SDL_Keycode sym; + enum PspHprmKeys id; + SDL_Keycode sym; } keymap_psp[] = { - { PSP_HPRM_PLAYPAUSE, SDLK_F10 }, - { PSP_HPRM_FORWARD, SDLK_F11 }, - { PSP_HPRM_BACK, SDLK_F12 }, - { PSP_HPRM_VOL_UP, SDLK_F13 }, - { PSP_HPRM_VOL_DOWN, SDLK_F14 }, - { PSP_HPRM_HOLD, SDLK_F15 } + { PSP_HPRM_PLAYPAUSE, SDLK_F10 }, + { PSP_HPRM_FORWARD, SDLK_F11 }, + { PSP_HPRM_BACK, SDLK_F12 }, + { PSP_HPRM_VOL_UP, SDLK_F13 }, + { PSP_HPRM_VOL_DOWN, SDLK_F14 }, + { PSP_HPRM_HOLD, SDLK_F15 } }; int EventUpdate(void *data) { - while (running) { + while (running) { SDL_SemWait(event_sem); - sceHprmPeekCurrentKey(&hprm); + sceHprmPeekCurrentKey(&hprm); SDL_SemPost(event_sem); /* Delay 1/60th of a second */ - sceKernelDelayThread(1000000 / 60); + sceKernelDelayThread(1000000 / 60); } return 0; } void PSP_PumpEvents(_THIS) { - int i; - enum PspHprmKeys keys; - enum PspHprmKeys changed; - static enum PspHprmKeys old_keys = 0; - SDL_Keysym sym; + int i; + enum PspHprmKeys keys; + enum PspHprmKeys changed; + static enum PspHprmKeys old_keys = 0; + SDL_Keysym sym; - SDL_SemWait(event_sem); - keys = hprm; - SDL_SemPost(event_sem); + SDL_SemWait(event_sem); + keys = hprm; + SDL_SemPost(event_sem); - /* HPRM Keyboard */ - changed = old_keys ^ keys; - old_keys = keys; - if(changed) { - for(i=0; i= 0) { - if((length % sizeof(SIrKeybScanCodeData)) == 0){ - count = length / sizeof(SIrKeybScanCodeData); - for( i=0; i < count; i++ ) { - unsigned char raw, pressed; - scanData=(SIrKeybScanCodeData*) buffer+i; - raw = scanData->raw; - pressed = scanData->pressed; - sym.scancode = raw; - sym.sym = keymap[raw]; - /* not tested*/ - //SDL_PrivateKeyboard(pressed?SDL_PRESSED:SDL_RELEASED, &sym); - SDL_SendKeyboardKey((keys & keymap_psp[i].id) ? - SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap[raw]); - - } - } - } - } -#endif - sceKernelDelayThread(0); + if (irkbd_ready) { + unsigned char buffer[255]; + int i, length, count; + SIrKeybScanCodeData *scanData; - return; + if(pspIrKeybReadinput(buffer, &length) >= 0) { + if((length % sizeof(SIrKeybScanCodeData)) == 0){ + count = length / sizeof(SIrKeybScanCodeData); + for( i=0; i < count; i++ ) { + unsigned char raw, pressed; + scanData=(SIrKeybScanCodeData*) buffer+i; + raw = scanData->raw; + pressed = scanData->pressed; + sym.scancode = raw; + sym.sym = keymap[raw]; + /* not tested*/ + /*SDL_PrivateKeyboard(pressed?SDL_PRESSED:SDL_RELEASED, &sym); */ + SDL_SendKeyboardKey((keys & keymap_psp[i].id) ? + SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap[raw]); + + } + } + } + } +#endif + sceKernelDelayThread(0); + + return; } void PSP_InitOSKeymap(_THIS) { #ifdef PSPIRKEYB - int i; - for (i=0; igl_config.driver_loaded) { - _this->gl_config.driver_loaded = 1; + _this->gl_config.driver_loaded = 1; } return 0; } -/* pspgl doesn't provide this call, so stub it out since SDL requires it. +/* pspgl doesn't provide this call, so stub it out since SDL requires it. #define GLSTUB(func,params) void func params {} - + GLSTUB(glOrtho,(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, - GLdouble zNear, GLdouble zFar)) + GLdouble zNear, GLdouble zFar)) */ void * PSP_GL_GetProcAddress(_THIS, const char *proc) { - return eglGetProcAddress(proc); + return eglGetProcAddress(proc); } void PSP_GL_UnloadLibrary(_THIS) { - eglTerminate(_this->gl_data->display); + eglTerminate(_this->gl_data->display); } static EGLint width = 480; @@ -78,64 +78,64 @@ PSP_GL_CreateContext(_THIS, SDL_Window * window) SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; - EGLint attribs[32]; - EGLDisplay display; - EGLContext context; - EGLSurface surface; - EGLConfig config; - EGLint num_configs; - int i; - + EGLint attribs[32]; + EGLDisplay display; + EGLContext context; + EGLSurface surface; + EGLConfig config; + EGLint num_configs; + int i; - /* EGL init taken from glutCreateWindow() in PSPGL's glut.c. */ - EGLCHK(display = eglGetDisplay(0)); - EGLCHK(eglInitialize(display, NULL, NULL)); - wdata->uses_gles = SDL_TRUE; - window->flags |= SDL_WINDOW_FULLSCREEN; - - /* Setup the config based on SDL's current values. */ - i = 0; - attribs[i++] = EGL_RED_SIZE; - attribs[i++] = _this->gl_config.red_size; - attribs[i++] = EGL_GREEN_SIZE; - attribs[i++] = _this->gl_config.green_size; - attribs[i++] = EGL_BLUE_SIZE; - attribs[i++] = _this->gl_config.blue_size; - attribs[i++] = EGL_DEPTH_SIZE; - attribs[i++] = _this->gl_config.depth_size; - - if (_this->gl_config.alpha_size) - { - attribs[i++] = EGL_ALPHA_SIZE; - attribs[i++] = _this->gl_config.alpha_size; - } - if (_this->gl_config.stencil_size) - { - attribs[i++] = EGL_STENCIL_SIZE; - attribs[i++] = _this->gl_config.stencil_size; - } - - attribs[i++] = EGL_NONE; - - EGLCHK(eglChooseConfig(display, attribs, &config, 1, &num_configs)); - - if (num_configs == 0) - { - SDL_SetError("No valid EGL configs for requested mode"); - return 0; - } - - EGLCHK(eglGetConfigAttrib(display, config, EGL_WIDTH, &width)); - EGLCHK(eglGetConfigAttrib(display, config, EGL_HEIGHT, &height)); - EGLCHK(context = eglCreateContext(display, config, NULL, NULL)); - EGLCHK(surface = eglCreateWindowSurface(display, config, 0, NULL)); - EGLCHK(eglMakeCurrent(display, surface, surface, context)); - - _this->gl_data->display = display; - _this->gl_data->context = context; - _this->gl_data->surface = surface; - + /* EGL init taken from glutCreateWindow() in PSPGL's glut.c. */ + EGLCHK(display = eglGetDisplay(0)); + EGLCHK(eglInitialize(display, NULL, NULL)); + wdata->uses_gles = SDL_TRUE; + window->flags |= SDL_WINDOW_FULLSCREEN; + + /* Setup the config based on SDL's current values. */ + i = 0; + attribs[i++] = EGL_RED_SIZE; + attribs[i++] = _this->gl_config.red_size; + attribs[i++] = EGL_GREEN_SIZE; + attribs[i++] = _this->gl_config.green_size; + attribs[i++] = EGL_BLUE_SIZE; + attribs[i++] = _this->gl_config.blue_size; + attribs[i++] = EGL_DEPTH_SIZE; + attribs[i++] = _this->gl_config.depth_size; + + if (_this->gl_config.alpha_size) + { + attribs[i++] = EGL_ALPHA_SIZE; + attribs[i++] = _this->gl_config.alpha_size; + } + if (_this->gl_config.stencil_size) + { + attribs[i++] = EGL_STENCIL_SIZE; + attribs[i++] = _this->gl_config.stencil_size; + } + + attribs[i++] = EGL_NONE; + + EGLCHK(eglChooseConfig(display, attribs, &config, 1, &num_configs)); + + if (num_configs == 0) + { + SDL_SetError("No valid EGL configs for requested mode"); + return 0; + } + + EGLCHK(eglGetConfigAttrib(display, config, EGL_WIDTH, &width)); + EGLCHK(eglGetConfigAttrib(display, config, EGL_HEIGHT, &height)); + + EGLCHK(context = eglCreateContext(display, config, NULL, NULL)); + EGLCHK(surface = eglCreateWindowSurface(display, config, 0, NULL)); + EGLCHK(eglMakeCurrent(display, surface, surface, context)); + + _this->gl_data->display = display; + _this->gl_data->context = context; + _this->gl_data->surface = surface; + return context; } @@ -143,18 +143,18 @@ PSP_GL_CreateContext(_THIS, SDL_Window * window) int PSP_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { - if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface, - _this->gl_data->surface, _this->gl_data->context)) - { - return SDL_SetError("Unable to make EGL context current"); - } + if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface, + _this->gl_data->surface, _this->gl_data->context)) + { + return SDL_SetError("Unable to make EGL context current"); + } return 0; } int PSP_GL_SetSwapInterval(_THIS, int interval) { - EGLBoolean status; + EGLBoolean status; status = eglSwapInterval(_this->gl_data->display, interval); if (status == EGL_TRUE) { /* Return success to upper level */ diff --git a/src/video/psp/SDL_pspgl_c.h b/src/video/psp/SDL_pspgl_c.h index 73235ef68..8b20d1544 100644 --- a/src/video/psp/SDL_pspgl_c.h +++ b/src/video/psp/SDL_pspgl_c.h @@ -30,9 +30,9 @@ typedef struct SDL_GLDriverData { - EGLDisplay display; - EGLContext context; - EGLSurface surface; + EGLDisplay display; + EGLContext context; + EGLSurface surface; uint32_t swapinterval; }SDL_GLDriverData; diff --git a/src/video/psp/SDL_pspmouse.c b/src/video/psp/SDL_pspmouse.c index 8f0ffdc7d..002a518b4 100644 --- a/src/video/psp/SDL_pspmouse.c +++ b/src/video/psp/SDL_pspmouse.c @@ -31,5 +31,5 @@ /* The implementation dependent data for the window manager cursor */ struct WMcursor { - int unused; + int unused; }; diff --git a/src/video/psp/SDL_pspvideo.c b/src/video/psp/SDL_pspvideo.c index 8ed637551..ed5ab1c96 100644 --- a/src/video/psp/SDL_pspvideo.c +++ b/src/video/psp/SDL_pspvideo.c @@ -51,7 +51,7 @@ PSP_Available(void) static void PSP_Destroy(SDL_VideoDevice * device) { -// SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; +/* SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; */ if (device->driverdata != NULL) { device->driverdata = NULL; @@ -87,15 +87,15 @@ PSP_Create() SDL_free(device); return NULL; } - - gldata = (SDL_GLDriverData *) SDL_calloc(1, sizeof(SDL_GLDriverData)); + + gldata = (SDL_GLDriverData *) SDL_calloc(1, sizeof(SDL_GLDriverData)); if (gldata == NULL) { SDL_OutOfMemory(); SDL_free(device); return NULL; - } + } device->gl_data = gldata; - + device->driverdata = phdata; phdata->egl_initialized = SDL_TRUE; @@ -136,11 +136,11 @@ PSP_Create() device->GL_GetSwapInterval = PSP_GL_GetSwapInterval; device->GL_SwapWindow = PSP_GL_SwapWindow; device->GL_DeleteContext = PSP_GL_DeleteContext; - device->SDL_HasScreenKeyboardSupport = PSP_SDL_HasScreenKeyboardSupport; - device->SDL_ShowScreenKeyboard = PSP_SDL_ShowScreenKeyboard; - device->SDL_HideScreenKeyboard = PSP_SDL_HideScreenKeyboard; - device->SDL_IsScreenKeyboardShown = PSP_SDL_IsScreenKeyboardShown; - + device->HasScreenKeyboardSupport = PSP_HasScreenKeyboardSupport; + device->ShowScreenKeyboard = PSP_ShowScreenKeyboard; + device->HideScreenKeyboard = PSP_HideScreenKeyboard; + device->IsScreenKeyboardShown = PSP_IsScreenKeyboardShown; + device->PumpEvents = PSP_PumpEvents; return device; @@ -163,15 +163,14 @@ PSP_VideoInit(_THIS) SDL_DisplayMode current_mode; SDL_zero(current_mode); - + current_mode.w = 480; current_mode.h = 272; - + current_mode.refresh_rate = 60; - // 32 bpp for default - // current_mode.format = SDL_PIXELFORMAT_RGBA8888; + /* 32 bpp for default */ current_mode.format = SDL_PIXELFORMAT_ABGR8888; - + current_mode.driverdata = NULL; SDL_zero(display); @@ -201,23 +200,21 @@ PSP_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) { return 0; } -#define EGLCHK(stmt) \ - do { \ - EGLint err; \ - \ - stmt; \ - err = eglGetError(); \ - if (err != EGL_SUCCESS) { \ - SDL_SetError("EGL error %d", err); \ - return 0; \ - } \ - } while (0) - +#define EGLCHK(stmt) \ + do { \ + EGLint err; \ + \ + stmt; \ + err = eglGetError(); \ + if (err != EGL_SUCCESS) { \ + SDL_SetError("EGL error %d", err); \ + return 0; \ + } \ + } while (0) + int PSP_CreateWindow(_THIS, SDL_Window * window) { -// SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - SDL_WindowData *wdata; /* Allocate window internal data */ @@ -288,8 +285,6 @@ PSP_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) void PSP_DestroyWindow(_THIS, SDL_Window * window) { - -// eglTerminate(_this->gl_data->display); } /*****************************************************************************/ @@ -312,19 +307,19 @@ PSP_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) /* TO Write Me*/ -SDL_bool PSP_SDL_HasScreenKeyboardSupport(_THIS) +SDL_bool PSP_HasScreenKeyboardSupport(_THIS) { - return SDL_TRUE; + return SDL_FALSE; } -void PSP_SDL_ShowScreenKeyboard(_THIS, SDL_Window *window) +void PSP_ShowScreenKeyboard(_THIS, SDL_Window *window) { } -void PSP_SDL_HideScreenKeyboard(_THIS, SDL_Window *window) +void PSP_HideScreenKeyboard(_THIS, SDL_Window *window) { } -SDL_bool PSP_SDL_IsScreenKeyboardShown(_THIS, SDL_Window *window) +SDL_bool PSP_IsScreenKeyboardShown(_THIS, SDL_Window *window) { - return SDL_FALSE; + return SDL_FALSE; } diff --git a/src/video/psp/SDL_pspvideo.h b/src/video/psp/SDL_pspvideo.h index 7209cb156..d4ab32bfe 100644 --- a/src/video/psp/SDL_pspvideo.h +++ b/src/video/psp/SDL_pspvideo.h @@ -31,7 +31,7 @@ typedef struct SDL_VideoData { SDL_bool egl_initialized; /* OpenGL ES device initialization status */ uint32_t egl_refcount; /* OpenGL ES reference count */ - + } SDL_VideoData; @@ -46,7 +46,7 @@ typedef struct SDL_DisplayData typedef struct SDL_WindowData { SDL_bool uses_gles; /* if true window must support OpenGL ES */ - + } SDL_WindowData; @@ -92,11 +92,11 @@ void PSP_GL_SwapWindow(_THIS, SDL_Window * window); void PSP_GL_DeleteContext(_THIS, SDL_GLContext context); /*PSP on screen keyboard */ -SDL_bool PSP_SDL_HasScreenKeyboardSupport(_THIS); -void PSP_SDL_ShowScreenKeyboard(_THIS, SDL_Window *window); -void PSP_SDL_HideScreenKeyboard(_THIS, SDL_Window *window); -SDL_bool PSP_SDL_IsScreenKeyboardShown(_THIS, SDL_Window *window); - +SDL_bool PSP_HasScreenKeyboardSupport(_THIS); +void PSP_ShowScreenKeyboard(_THIS, SDL_Window *window); +void PSP_HideScreenKeyboard(_THIS, SDL_Window *window); +SDL_bool PSP_IsScreenKeyboardShown(_THIS, SDL_Window *window); + #endif /* __SDL_PANDORA_H__ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/sdlgenblit.pl b/src/video/sdlgenblit.pl index 3a0561476..1097488f5 100755 --- a/src/video/sdlgenblit.pl +++ b/src/video/sdlgenblit.pl @@ -82,7 +82,7 @@ sub open_file { /* DO NOT EDIT! This file is generated by sdlgenblit.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2013 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -241,6 +241,7 @@ __EOF__ ${d}R = ${s}R + ((255 - ${s}A) * ${d}R) / 255; ${d}G = ${s}G + ((255 - ${s}A) * ${d}G) / 255; ${d}B = ${s}B + ((255 - ${s}A) * ${d}B) / 255; + ${d}A = ${s}A + ((255 - ${s}A) * ${d}A) / 255; break; case SDL_COPY_ADD: ${d}R = ${s}R + ${d}R; if (${d}R > 255) ${d}R = 255; diff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m index 5337f619e..4a3232005 100644 --- a/src/video/uikit/SDL_uikitappdelegate.m +++ b/src/video/uikit/SDL_uikitappdelegate.m @@ -25,19 +25,17 @@ #include "../SDL_sysvideo.h" #include "SDL_assert.h" #include "SDL_hints.h" -#include "../../SDL_hints_c.h" #include "SDL_system.h" +#include "SDL_main.h" #include "SDL_uikitappdelegate.h" #include "SDL_uikitmodes.h" #include "../../events/SDL_events_c.h" -#include "jumphack.h" #ifdef main #undef main #endif -extern int SDL_main(int argc, char *argv[]); static int forward_argc; static char **forward_argv; static int exit_status; @@ -70,11 +68,10 @@ int main(int argc, char **argv) return exit_status; } -static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, const char *newValue) +static void +SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { - SDL_assert(SDL_strcmp(name, SDL_HINT_IDLE_TIMER_DISABLED) == 0); - - BOOL disable = (*newValue != '0'); + BOOL disable = (hint && *hint != '0'); [UIApplication sharedApplication].idleTimerDisabled = disable; } @@ -117,7 +114,7 @@ static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, if (self->splashLandscape) { [self->splashLandscape retain]; } - + [self updateSplashImage:[[UIApplication sharedApplication] statusBarOrientation]]; return self; @@ -126,8 +123,8 @@ static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, - (NSUInteger)supportedInterfaceOrientations { NSUInteger orientationMask = UIInterfaceOrientationMaskAll; - - // Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation + + /* Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation */ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { orientationMask &= ~UIInterfaceOrientationMaskPortraitUpsideDown; } @@ -148,7 +145,7 @@ static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, - (void)updateSplashImage:(UIInterfaceOrientation)interfaceOrientation { UIImage *image; - + if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) { image = self->splashLandscape; } else { @@ -199,9 +196,10 @@ static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, } /* exit, passing the return status from the user's application */ - // We don't actually exit to support applications that do setup in - // their main function and then allow the Cocoa event loop to run. - // exit(exit_status); + /* We don't actually exit to support applications that do setup in + * their main function and then allow the Cocoa event loop to run. + */ + /* exit(exit_status); */ } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions @@ -218,9 +216,10 @@ static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]]; /* register a callback for the idletimer hint */ - SDL_SetHint(SDL_HINT_IDLE_TIMER_DISABLED, "0"); - SDL_RegisterHintChangedCb(SDL_HINT_IDLE_TIMER_DISABLED, &SDL_IdleTimerDisabledChanged); + SDL_AddHintCallback(SDL_HINT_IDLE_TIMER_DISABLED, + SDL_IdleTimerDisabledChanged, NULL); + SDL_SetMainReady(); [self performSelector:@selector(postFinishLaunch) withObject:nil afterDelay:0.0]; return YES; @@ -228,42 +227,48 @@ static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, - (void)applicationWillTerminate:(UIApplication *)application { - SDL_SendQuit(); - /* hack to prevent automatic termination. See SDL_uikitevents.m for details */ - longjmp(*(jump_env()), 1); + SDL_SendAppEvent(SDL_APP_TERMINATING); +} + +- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application +{ + SDL_SendAppEvent(SDL_APP_LOWMEMORY); } - (void) applicationWillResignActive:(UIApplication*)application { - //NSLog(@"%@", NSStringFromSelector(_cmd)); - - // Send every window on every screen a MINIMIZED event. SDL_VideoDevice *_this = SDL_GetVideoDevice(); - if (!_this) { - return; + if (_this) { + SDL_Window *window; + for (window = _this->windows; window != nil; window = window->next) { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MINIMIZED, 0, 0); + } } + SDL_SendAppEvent(SDL_APP_WILLENTERBACKGROUND); +} - SDL_Window *window; - for (window = _this->windows; window != nil; window = window->next) { - SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); - SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MINIMIZED, 0, 0); - } +- (void) applicationDidEnterBackground:(UIApplication*)application +{ + SDL_SendAppEvent(SDL_APP_DIDENTERBACKGROUND); +} + +- (void) applicationWillEnterForeground:(UIApplication*)application +{ + SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND); } - (void) applicationDidBecomeActive:(UIApplication*)application { - //NSLog(@"%@", NSStringFromSelector(_cmd)); + SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND); - // Send every window on every screen a RESTORED event. SDL_VideoDevice *_this = SDL_GetVideoDevice(); - if (!_this) { - return; - } - - SDL_Window *window; - for (window = _this->windows; window != nil; window = window->next) { - SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0); - SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0); + if (_this) { + SDL_Window *window; + for (window = _this->windows; window != nil; window = window->next) { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0); + } } } diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index b3f380eb8..16c120d79 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -28,7 +28,6 @@ #include "SDL_uikitevents.h" #import -#include "jumphack.h" static BOOL UIKit_EventPumpEnabled = YES; @@ -44,39 +43,24 @@ UIKit_PumpEvents(_THIS) if (!UIKit_EventPumpEnabled) return; - /* - When the user presses the 'home' button on the iPod - the application exits -- immediatly. + /* Let the run loop run for a short amount of time: long enough for + touch events to get processed (which is important to get certain + elements of Game Center's GKLeaderboardViewController to respond + to touch input), but not long enough to introduce a significant + delay in the rest of the app. + */ + const CFTimeInterval seconds = 0.000002; - Unlike in Mac OS X, it appears there is no way to cancel the termination. + /* Pump most event types. */ + SInt32 result; + do { + result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, seconds, TRUE); + } while (result == kCFRunLoopRunHandledSource); - This doesn't give the SDL user's application time to respond to an SDL_Quit event. - So what we do is that in the UIApplicationDelegate class (SDLUIApplicationDelegate), - when the delegate receives the ApplicationWillTerminate message, we execute - a longjmp statement to get back here, preventing an immediate exit. - */ - if (setjmp(*jump_env()) == 0) { - /* if we're setting the jump, rather than jumping back */ - - /* Let the run loop run for a short amount of time: long enough for - touch events to get processed (which is important to get certain - elements of Game Center's GKLeaderboardViewController to respond - to touch input), but not long enough to introduce a significant - delay in the rest of the app. - */ - const CFTimeInterval seconds = 0.000002; - - /* Pump most event types. */ - SInt32 result; - do { - result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, seconds, TRUE); - } while (result == kCFRunLoopRunHandledSource); - - /* Make sure UIScrollView objects scroll properly. */ - do { - result = CFRunLoopRunInMode((CFStringRef)UITrackingRunLoopMode, seconds, TRUE); - } while(result == kCFRunLoopRunHandledSource); - } + /* Make sure UIScrollView objects scroll properly. */ + do { + result = CFRunLoopRunInMode((CFStringRef)UITrackingRunLoopMode, seconds, TRUE); + } while(result == kCFRunLoopRunHandledSource); } #endif /* SDL_VIDEO_DRIVER_UIKIT */ diff --git a/src/video/uikit/SDL_uikitmessagebox.m b/src/video/uikit/SDL_uikitmessagebox.m index 26c218b01..5ec7e8b47 100644 --- a/src/video/uikit/SDL_uikitmessagebox.m +++ b/src/video/uikit/SDL_uikitmessagebox.m @@ -49,7 +49,7 @@ static SDL_bool s_showingMessageBox = SDL_FALSE; return nil; } self->clickedButtonIndex = buttonIndex; - + return self; } @@ -58,7 +58,7 @@ static SDL_bool s_showingMessageBox = SDL_FALSE; *clickedButtonIndex = buttonIndex; } -@end // UIKit_UIAlertViewDelegate +@end /* UIKit_UIAlertViewDelegate */ SDL_bool @@ -71,7 +71,7 @@ int UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { int clicked; - + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; UIAlertView* alert = [[UIAlertView alloc] init]; @@ -86,13 +86,13 @@ UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) [alert addButtonWithTitle:[[NSString alloc] initWithUTF8String:buttons[i].text]]; } - // Set up for showing the alert + /* Set up for showing the alert */ clicked = messageboxdata->numbuttons; [alert show]; - - // Run the main event loop until the alert has finished - // Note that this needs to be done on the main thread + + /* Run the main event loop until the alert has finished */ + /* Note that this needs to be done on the main thread */ s_showingMessageBox = SDL_TRUE; while (clicked == messageboxdata->numbuttons) { [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; @@ -100,7 +100,7 @@ UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) s_showingMessageBox = SDL_FALSE; *buttonid = messageboxdata->buttons[clicked].buttonid; - + [alert.delegate release]; [alert release]; diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index 87c3cc1e5..f093a81c6 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -34,22 +34,22 @@ UIKit_AllocateDisplayModeData(SDL_DisplayMode * mode, UIScreenMode * uiscreenmode, CGFloat scale) { SDL_DisplayModeData *data = NULL; - + if (uiscreenmode != nil) { /* Allocate the display mode data */ data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data)); if (!data) { return SDL_OutOfMemory(); } - + data->uiscreenmode = uiscreenmode; [data->uiscreenmode retain]; - + data->scale = scale; } - + mode->driverdata = data; - + return 0; } @@ -57,7 +57,7 @@ static void UIKit_FreeDisplayModeData(SDL_DisplayMode * mode) { if (!SDL_UIKit_supports_multiple_displays) { - // Not on at least iPhoneOS 3.2 (versions prior to iPad). + /* Not on at least iPhoneOS 3.2 (versions prior to iPad). */ SDL_assert(mode->driverdata == NULL); } else if (mode->driverdata != NULL) { SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; @@ -73,13 +73,13 @@ UIKit_AddSingleDisplayMode(SDL_VideoDisplay * display, int w, int h, { SDL_DisplayMode mode; SDL_zero(mode); - + mode.format = SDL_PIXELFORMAT_ABGR8888; mode.refresh_rate = 0; if (UIKit_AllocateDisplayModeData(&mode, uiscreenmode, scale) < 0) { return -1; } - + mode.w = w; mode.h = h; if (SDL_AddDisplayMode(display, &mode)) { @@ -97,14 +97,14 @@ UIKit_AddDisplayMode(SDL_VideoDisplay * display, int w, int h, CGFloat scale, if (UIKit_AddSingleDisplayMode(display, w, h, uiscreenmode, scale) < 0) { return -1; } - + if (addRotation) { - // Add the rotated version + /* Add the rotated version */ if (UIKit_AddSingleDisplayMode(display, h, w, uiscreenmode, scale) < 0) { return -1; } } - + return 0; } @@ -113,25 +113,26 @@ UIKit_AddDisplay(UIScreen *uiscreen) { CGSize size = [uiscreen bounds].size; - // Make sure the width/height are oriented correctly + /* Make sure the width/height are oriented correctly */ if (UIKit_IsDisplayLandscape(uiscreen) != (size.width > size.height)) { CGFloat height = size.width; size.width = size.height; size.height = height; } - // When dealing with UIKit all coordinates are specified in terms of - // what Apple refers to as points. On earlier devices without the - // so called "Retina" display, there is a one to one mapping between - // points and pixels. In other cases [UIScreen scale] indicates the - // relationship between points and pixels. Since SDL has no notion - // of points, we must compensate in all cases where dealing with such - // units. + /* When dealing with UIKit all coordinates are specified in terms of + * what Apple refers to as points. On earlier devices without the + * so called "Retina" display, there is a one to one mapping between + * points and pixels. In other cases [UIScreen scale] indicates the + * relationship between points and pixels. Since SDL has no notion + * of points, we must compensate in all cases where dealing with such + * units. + */ CGFloat scale; if ([UIScreen instancesRespondToSelector:@selector(scale)]) { - scale = [uiscreen scale]; // iOS >= 4.0 + scale = [uiscreen scale]; /* iOS >= 4.0 */ } else { - scale = 1.0f; // iOS < 4.0 + scale = 1.0f; /* iOS < 4.0 */ } SDL_VideoDisplay display; @@ -140,14 +141,15 @@ UIKit_AddDisplay(UIScreen *uiscreen) mode.format = SDL_PIXELFORMAT_ABGR8888; mode.w = (int)(size.width * scale); mode.h = (int)(size.height * scale); - + UIScreenMode * uiscreenmode = nil; - // UIScreenMode showed up in 3.2 (the iPad and later). We're - // misusing this supports_multiple_displays flag here for that. + /* UIScreenMode showed up in 3.2 (the iPad and later). We're + * misusing this supports_multiple_displays flag here for that. + */ if (SDL_UIKit_supports_multiple_displays) { uiscreenmode = [uiscreen currentMode]; } - + if (UIKit_AllocateDisplayModeData(&mode, uiscreenmode, scale) < 0) { return -1; } @@ -162,14 +164,14 @@ UIKit_AddDisplay(UIScreen *uiscreen) UIKit_FreeDisplayModeData(&display.desktop_mode); return SDL_OutOfMemory(); } - + [uiscreen retain]; data->uiscreen = uiscreen; data->scale = scale; - + display.driverdata = data; SDL_AddVideoDisplay(&display); - + return 0; } @@ -187,20 +189,21 @@ UIKit_IsDisplayLandscape(UIScreen *uiscreen) int UIKit_InitModes(_THIS) { - // this tells us whether we are running on ios >= 3.2 + /* this tells us whether we are running on ios >= 3.2 */ SDL_UIKit_supports_multiple_displays = [UIScreen instancesRespondToSelector:@selector(currentMode)]; - // Add the main screen. + /* Add the main screen. */ if (UIKit_AddDisplay([UIScreen mainScreen]) < 0) { return -1; } - // If this is iPhoneOS < 3.2, all devices are one screen, 320x480 pixels. - // The iPad added both a larger main screen and the ability to use - // external displays. So, add the other displays (screens in UI speak). + /* If this is iPhoneOS < 3.2, all devices are one screen, 320x480 pixels. */ + /* The iPad added both a larger main screen and the ability to use + * external displays. So, add the other displays (screens in UI speak). + */ if (SDL_UIKit_supports_multiple_displays) { for (UIScreen *uiscreen in [UIScreen screens]) { - // Only add the other screens + /* Only add the other screens */ if (uiscreen != [UIScreen mainScreen]) { if (UIKit_AddDisplay(uiscreen) < 0) { return -1; @@ -222,27 +225,28 @@ UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display) SDL_bool addRotation = (data->uiscreen == [UIScreen mainScreen]); if (SDL_UIKit_supports_multiple_displays) { - // availableModes showed up in 3.2 (the iPad and later). We should only - // land here for at least that version of the OS. + /* availableModes showed up in 3.2 (the iPad and later). We should only + * land here for at least that version of the OS. + */ for (UIScreenMode *uimode in [data->uiscreen availableModes]) { CGSize size = [uimode size]; int w = (int)size.width; int h = (int)size.height; - - // Make sure the width/height are oriented correctly + + /* Make sure the width/height are oriented correctly */ if (isLandscape != (w > h)) { int tmp = w; w = h; h = tmp; } - // Add the native screen resolution. + /* Add the native screen resolution. */ UIKit_AddDisplayMode(display, w, h, data->scale, uimode, addRotation); if (data->scale != 1.0f) { - // Add the native screen resolution divided by its scale. - // This is so devices capable of e.g. 640x960 also advertise - // 320x480. + /* Add the native screen resolution divided by its scale. + * This is so devices capable of e.g. 640x960 also advertise 320x480. + */ UIKit_AddDisplayMode(display, (int)(size.width / data->scale), (int)(size.height / data->scale), @@ -254,7 +258,7 @@ UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display) int w = (int)size.width; int h = (int)size.height; - // Make sure the width/height are oriented correctly + /* Make sure the width/height are oriented correctly */ if (isLandscape != (w > h)) { int tmp = w; w = h; @@ -262,7 +266,7 @@ UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display) } UIKit_AddDisplayMode(display, w, h, 1.0f, nil, addRotation); - } + } } int @@ -271,7 +275,7 @@ UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; if (!SDL_UIKit_supports_multiple_displays) { - // Not on at least iPhoneOS 3.2 (versions prior to iPad). + /* Not on at least iPhoneOS 3.2 (versions prior to iPad). */ SDL_assert(mode->driverdata == NULL); } else { SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata; @@ -295,7 +299,7 @@ UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) void UIKit_QuitModes(_THIS) { - // Release Objective-C objects, so higher level doesn't free() them. + /* Release Objective-C objects, so higher level doesn't free() them. */ int i, j; for (i = 0; i < _this->num_displays; i++) { SDL_VideoDisplay *display = &_this->displays[i]; diff --git a/src/video/uikit/SDL_uikitopengles.m b/src/video/uikit/SDL_uikitopengles.m index f3efab2a7..d1cb20745 100644 --- a/src/video/uikit/SDL_uikitopengles.m +++ b/src/video/uikit/SDL_uikitopengles.m @@ -27,7 +27,6 @@ #include "SDL_uikitappdelegate.h" #include "SDL_uikitmodes.h" #include "SDL_uikitwindow.h" -#include "jumphack.h" #include "../SDL_sysvideo.h" #include "../../events/SDL_keyboard_c.h" #include "../../events/SDL_mouse_c.h" @@ -80,7 +79,7 @@ UIKit_GL_LoadLibrary(_THIS, const char *path) void UIKit_GL_SwapWindow(_THIS, SDL_Window * window) { #if SDL_POWER_UIKIT - // Check once a frame to see if we should turn off the battery monitor. + /* Check once a frame to see if we should turn off the battery monitor. */ SDL_UIKit_UpdateBatteryMonitoring(); #endif @@ -91,8 +90,10 @@ void UIKit_GL_SwapWindow(_THIS, SDL_Window * window) } [data->view swapBuffers]; - /* we need to let the event cycle run, or the OS won't update the OpenGL view! */ - SDL_PumpEvents(); + /* You need to pump events in order for the OS to make changes visible. + We don't pump events here because we don't want iOS application events + (low memory, terminate, etc.) to happen inside low level rendering. + */ } SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window) @@ -103,6 +104,12 @@ SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window) SDL_DisplayData *displaydata = display->driverdata; SDL_DisplayModeData *displaymodedata = display->current_mode.driverdata; UIWindow *uiwindow = data->uiwindow; + EAGLSharegroup *share_group = nil; + + if (_this->gl_config.share_with_current_context) { + SDL_uikitopenglview *view = (SDL_uikitopenglview *) SDL_GL_GetCurrentContext(); + share_group = [view.context sharegroup]; + } /* construct our view, passing in SDL's OpenGL configuration data */ CGRect frame; @@ -120,7 +127,8 @@ SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window) aBits: _this->gl_config.alpha_size depthBits: _this->gl_config.depth_size stencilBits: _this->gl_config.stencil_size - majorVersion: _this->gl_config.major_version]; + majorVersion: _this->gl_config.major_version + shareGroup: share_group]; if (!view) { return NULL; } @@ -132,8 +140,8 @@ SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window) [view->viewcontroller retain]; } [uiwindow addSubview: view]; - - // The view controller needs to be the root in order to control rotation on iOS 6.0 + + /* The view controller needs to be the root in order to control rotation on iOS 6.0 */ if (uiwindow.rootViewController == nil) { uiwindow.rootViewController = view->viewcontroller; } diff --git a/src/video/uikit/SDL_uikitopenglview.h b/src/video/uikit/SDL_uikitopenglview.h index b29cca2c5..344ad6a5e 100644 --- a/src/video/uikit/SDL_uikitopenglview.h +++ b/src/video/uikit/SDL_uikitopenglview.h @@ -67,7 +67,8 @@ aBits:(int)aBits depthBits:(int)depthBits stencilBits:(int)stencilBits - majorVersion:(int)majorVersion; + majorVersion:(int)majorVersion + shareGroup:(EAGLSharegroup*)shareGroup; - (void)updateFrame; diff --git a/src/video/uikit/SDL_uikitopenglview.m b/src/video/uikit/SDL_uikitopenglview.m index 16ac872d9..9f3dc136a 100644 --- a/src/video/uikit/SDL_uikitopenglview.m +++ b/src/video/uikit/SDL_uikitopenglview.m @@ -47,6 +47,7 @@ depthBits:(int)depthBits stencilBits:(int)stencilBits majorVersion:(int)majorVersion + shareGroup:(EAGLSharegroup*)shareGroup { depthBufferFormat = 0; @@ -71,9 +72,9 @@ [NSNumber numberWithBool: retained], kEAGLDrawablePropertyRetainedBacking, colorFormat, kEAGLDrawablePropertyColorFormat, nil]; if (majorVersion > 1) { - context = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES2]; + context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:shareGroup]; } else { - context = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES1]; + context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1 sharegroup:shareGroup]; } if (!context || ![EAGLContext setCurrentContext:context]) { [self release]; @@ -165,9 +166,10 @@ - (void)startAnimation { - // CADisplayLink is API new to iPhone SDK 3.1. Compiling against earlier versions will result in a warning, but can be dismissed - // if the system version runtime check for CADisplayLink exists in -initWithCoder:. - + /* CADisplayLink is API new to iPhone SDK 3.1. + * Compiling against earlier versions will result in a warning, but can be dismissed + * if the system version runtime check for CADisplayLink exists in -initWithCoder:. + */ displayLink = [NSClassFromString(@"CADisplayLink") displayLinkWithTarget:self selector:@selector(doLoop:)]; [displayLink setFrameInterval:animationInterval]; [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; @@ -181,7 +183,7 @@ - (void)doLoop:(id)sender { - // Don't run the game loop while a messagebox is up + /* Don't run the game loop while a messagebox is up */ if (!UIKit_ShowingMessageBox()) { animationCallback(animationCallbackParam); } diff --git a/src/video/uikit/SDL_uikitvideo.h b/src/video/uikit/SDL_uikitvideo.h index c8418faa4..8969e91e9 100644 --- a/src/video/uikit/SDL_uikitvideo.h +++ b/src/video/uikit/SDL_uikitvideo.h @@ -26,7 +26,7 @@ #include "../SDL_sysvideo.h" #ifndef __IPHONE_6_0 -// This enum isn't available in older SDKs, but we use it for our own purposes on iOS 5.1 and for the system on iOS 6.0 +/* This enum isn't available in older SDKs, but we use it for our own purposes on iOS 5.1 and for the system on iOS 6.0 */ enum UIInterfaceOrientationMask { UIInterfaceOrientationMaskPortrait = (1 << UIInterfaceOrientationPortrait), @@ -37,7 +37,7 @@ enum UIInterfaceOrientationMask UIInterfaceOrientationMaskAll = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown), UIInterfaceOrientationMaskAllButUpsideDown = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight), }; -#endif // !__IPHONE_6_0 +#endif /* !__IPHONE_6_0 */ #endif /* _SDL_uikitvideo_h */ diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index ff025067b..662b10906 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -86,10 +86,12 @@ UIKit_CreateDevice(int devindex) /* !!! FIXME: implement SetWindowBordered */ - device->SDL_HasScreenKeyboardSupport = UIKit_HasScreenKeyboardSupport; - device->SDL_ShowScreenKeyboard = UIKit_ShowScreenKeyboard; - device->SDL_HideScreenKeyboard = UIKit_HideScreenKeyboard; - device->SDL_IsScreenKeyboardShown = UIKit_IsScreenKeyboardShown; +#if SDL_IPHONE_KEYBOARD + device->HasScreenKeyboardSupport = UIKit_HasScreenKeyboardSupport; + device->ShowScreenKeyboard = UIKit_ShowScreenKeyboard; + device->HideScreenKeyboard = UIKit_HideScreenKeyboard; + device->IsScreenKeyboardShown = UIKit_IsScreenKeyboardShown; +#endif /* OpenGL (ES) functions */ device->GL_MakeCurrent = UIKit_GL_MakeCurrent; diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index 82cce3cbf..e808962ef 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -30,10 +30,10 @@ #if SDL_IPHONE_KEYBOARD #include "keyinfotable.h" +#endif #include "SDL_uikitappdelegate.h" #include "SDL_uikitmodes.h" #include "SDL_uikitwindow.h" -#endif @implementation SDL_uikitview @@ -63,11 +63,11 @@ { CGPoint point = [touch locationInView: self]; - // Get the display scale and apply that to the input coordinates + /* Get the display scale and apply that to the input coordinates */ SDL_Window *window = self->viewcontroller.window; SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata; - + if (normalize) { CGRect bounds = [self bounds]; point.x /= bounds.size.width; @@ -99,9 +99,10 @@ CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS - // FIXME: TODO: Using touch as the fingerId is potentially dangerous - // It is also much more efficient than storing the UITouch pointer - // and comparing it to the incoming event. + /* FIXME: TODO: Using touch as the fingerId is potentially dangerous + * It is also much more efficient than storing the UITouch pointer + * and comparing it to the incoming event. + */ SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch), SDL_TRUE, locationInView.x, locationInView.y, 1.0f); #else diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index 896a76f0e..157b70aa0 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -51,7 +51,7 @@ - (void)loadView { - // do nothing. + /* do nothing. */ } - (void)viewDidLayoutSubviews @@ -62,10 +62,10 @@ SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata; const CGSize size = data->view.bounds.size; int w, h; - + w = (int)(size.width * displaymodedata->scale); h = (int)(size.height * displaymodedata->scale); - + SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h); } } @@ -73,7 +73,7 @@ - (NSUInteger)supportedInterfaceOrientations { NSUInteger orientationMask = 0; - + const char *orientationsCString; if ((orientationsCString = SDL_GetHint(SDL_HINT_ORIENTATIONS)) != NULL) { BOOL rotate = NO; @@ -81,7 +81,7 @@ encoding:NSUTF8StringEncoding]; NSArray *orientations = [orientationsNSString componentsSeparatedByCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@" "]]; - + if ([orientations containsObject:@"LandscapeLeft"]) { orientationMask |= UIInterfaceOrientationMaskLandscapeLeft; } @@ -94,9 +94,9 @@ if ([orientations containsObject:@"PortraitUpsideDown"]) { orientationMask |= UIInterfaceOrientationMaskPortraitUpsideDown; } - + } else if (self->window->flags & SDL_WINDOW_RESIZABLE) { - orientationMask = UIInterfaceOrientationMaskAll; // any orientation is okay. + orientationMask = UIInterfaceOrientationMaskAll; /* any orientation is okay. */ } else { if (self->window->w >= self->window->h) { orientationMask |= UIInterfaceOrientationMaskLandscape; @@ -105,8 +105,8 @@ orientationMask |= (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown); } } - - // Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation + + /* Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation */ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { orientationMask &= ~UIInterfaceOrientationMaskPortraitUpsideDown; } diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index e18065fa4..0285b6bcc 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -76,7 +76,7 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo int width = (int)(bounds.size.width * displaymodedata->scale); int height = (int)(bounds.size.height * displaymodedata->scale); - // Make sure the width/height are oriented correctly + /* Make sure the width/height are oriented correctly */ if (UIKit_IsDisplayLandscape(displaydata->uiscreen) != (width > height)) { int temp = width; width = height; @@ -92,30 +92,32 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo /* only one window on iOS, always shown */ window->flags &= ~SDL_WINDOW_HIDDEN; - // SDL_WINDOW_BORDERLESS controls whether status bar is hidden. - // This is only set if the window is on the main screen. Other screens - // just force the window to have the borderless flag. + /* SDL_WINDOW_BORDERLESS controls whether status bar is hidden. + * This is only set if the window is on the main screen. Other screens + * just force the window to have the borderless flag. + */ if (displaydata->uiscreen == [UIScreen mainScreen]) { - window->flags |= SDL_WINDOW_INPUT_FOCUS; // always has input focus - + window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */ + if ([UIApplication sharedApplication].statusBarHidden) { window->flags |= SDL_WINDOW_BORDERLESS; } else { window->flags &= ~SDL_WINDOW_BORDERLESS; } } else { - window->flags &= ~SDL_WINDOW_RESIZABLE; // window is NEVER resizeable - window->flags &= ~SDL_WINDOW_INPUT_FOCUS; // never has input focus - window->flags |= SDL_WINDOW_BORDERLESS; // never has a status bar. + window->flags &= ~SDL_WINDOW_RESIZABLE; /* window is NEVER resizeable */ + window->flags &= ~SDL_WINDOW_INPUT_FOCUS; /* never has input focus */ + window->flags |= SDL_WINDOW_BORDERLESS; /* never has a status bar. */ } - // The View Controller will handle rotating the view when the - // device orientation changes. This will trigger resize events, if - // appropriate. + /* The View Controller will handle rotating the view when the + * device orientation changes. This will trigger resize events, if + * appropriate. + */ SDL_uikitviewcontroller *controller; controller = [SDL_uikitviewcontroller alloc]; data->viewcontroller = [controller initWithSDLWindow:window]; - [data->viewcontroller setTitle:@"SDL App"]; // !!! FIXME: hook up SDL_SetWindowTitle() + [data->viewcontroller setTitle:@"SDL App"]; /* !!! FIXME: hook up SDL_SetWindowTitle() */ return 0; } @@ -127,7 +129,7 @@ UIKit_CreateWindow(_THIS, SDL_Window *window) SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; const BOOL external = ([UIScreen mainScreen] != data->uiscreen); - // SDL currently puts this window at the start of display's linked list. We rely on this. + /* SDL currently puts this window at the start of display's linked list. We rely on this. */ SDL_assert(_this->windows == window); /* We currently only handle a single window per display on iOS */ @@ -135,9 +137,10 @@ UIKit_CreateWindow(_THIS, SDL_Window *window) return SDL_SetError("Only one window allowed per display."); } - // If monitor has a resolution of 0x0 (hasn't been explicitly set by the - // user, so it's in standby), try to force the display to a resolution - // that most closely matches the desired window size. + /* If monitor has a resolution of 0x0 (hasn't been explicitly set by the + * user, so it's in standby), try to force the display to a resolution + * that most closely matches the desired window size. + */ if (SDL_UIKit_supports_multiple_displays) { const CGSize origsize = [[data->uiscreen currentMode] size]; if ((origsize.width == 0.0f) && (origsize.height == 0.0f)) { @@ -157,14 +160,15 @@ UIKit_CreateWindow(_THIS, SDL_Window *window) SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)bestmode->driverdata; [data->uiscreen setCurrentMode:modedata->uiscreenmode]; - // desktop_mode doesn't change here (the higher level will - // use it to set all the screens back to their defaults - // upon window destruction, SDL_Quit(), etc. + /* desktop_mode doesn't change here (the higher level will + * use it to set all the screens back to their defaults + * upon window destruction, SDL_Quit(), etc. + */ display->current_mode = *bestmode; } } } - + if (data->uiscreen == [UIScreen mainScreen]) { if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) { [UIApplication sharedApplication].statusBarHidden = YES; @@ -172,7 +176,7 @@ UIKit_CreateWindow(_THIS, SDL_Window *window) [UIApplication sharedApplication].statusBarHidden = NO; } } - + if (!(window->flags & SDL_WINDOW_RESIZABLE)) { if (window->w > window->h) { if (!UIKit_IsDisplayLandscape(data->uiscreen)) { @@ -186,14 +190,15 @@ UIKit_CreateWindow(_THIS, SDL_Window *window) } /* ignore the size user requested, and make a fullscreen window */ - // !!! FIXME: can we have a smaller view? + /* !!! FIXME: can we have a smaller view? */ UIWindow *uiwindow = [UIWindow alloc]; uiwindow = [uiwindow initWithFrame:[data->uiscreen bounds]]; - // put the window on an external display if appropriate. This implicitly - // does [uiwindow setframe:[uiscreen bounds]], so don't do it on the - // main display, where we land by default, as that would eat the - // status bar real estate. + /* put the window on an external display if appropriate. This implicitly + * does [uiwindow setframe:[uiscreen bounds]], so don't do it on the + * main display, where we land by default, as that would eat the + * status bar real estate. + */ if (external) { [uiwindow setScreen:data->uiscreen]; } @@ -226,10 +231,11 @@ UIKit_HideWindow(_THIS, SDL_Window * window) void UIKit_RaiseWindow(_THIS, SDL_Window * window) { - // We don't currently offer a concept of "raising" the SDL window, since - // we only allow one per display, in the iOS fashion. - // However, we use this entry point to rebind the context to the view - // during OnWindowRestored processing. + /* We don't currently offer a concept of "raising" the SDL window, since + * we only allow one per display, in the iOS fashion. + * However, we use this entry point to rebind the context to the view + * during OnWindowRestored processing. + */ _this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx); } diff --git a/src/video/uikit/jumphack.c b/src/video/uikit/jumphack.c deleted file mode 100644 index 982ddda3e..000000000 --- a/src/video/uikit/jumphack.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jumphack.c - * SDLiPhoneOS - * - */ - -#include "jumphack.h" - -/* see SDL_uikitevents.m for more info */ - -/* stores the information we need to jump back */ -jmp_buf env; - -/* returns the jump environment for setting / getting purposes */ -jmp_buf * -jump_env(void) -{ - return &env; -} diff --git a/src/video/uikit/jumphack.h b/src/video/uikit/jumphack.h deleted file mode 100644 index 169498303..000000000 --- a/src/video/uikit/jumphack.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * jumphack.h - * SDLiPhoneOS - * - */ - -#ifndef _jumphack_h -#define _jumphack_h - -#include "setjmp.h" - -/* see SDL_uikitevents.m for more info */ - -extern jmp_buf *jump_env(void); - -#endif - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/windows/SDL_vkeys.h b/src/video/windows/SDL_vkeys.h index 2e835f543..ca24e8ff9 100644 --- a/src/video/windows/SDL_vkeys.h +++ b/src/video/windows/SDL_vkeys.h @@ -20,57 +20,57 @@ */ #ifndef VK_0 -#define VK_0 '0' -#define VK_1 '1' -#define VK_2 '2' -#define VK_3 '3' -#define VK_4 '4' -#define VK_5 '5' -#define VK_6 '6' -#define VK_7 '7' -#define VK_8 '8' -#define VK_9 '9' -#define VK_A 'A' -#define VK_B 'B' -#define VK_C 'C' -#define VK_D 'D' -#define VK_E 'E' -#define VK_F 'F' -#define VK_G 'G' -#define VK_H 'H' -#define VK_I 'I' -#define VK_J 'J' -#define VK_K 'K' -#define VK_L 'L' -#define VK_M 'M' -#define VK_N 'N' -#define VK_O 'O' -#define VK_P 'P' -#define VK_Q 'Q' -#define VK_R 'R' -#define VK_S 'S' -#define VK_T 'T' -#define VK_U 'U' -#define VK_V 'V' -#define VK_W 'W' -#define VK_X 'X' -#define VK_Y 'Y' -#define VK_Z 'Z' +#define VK_0 '0' +#define VK_1 '1' +#define VK_2 '2' +#define VK_3 '3' +#define VK_4 '4' +#define VK_5 '5' +#define VK_6 '6' +#define VK_7 '7' +#define VK_8 '8' +#define VK_9 '9' +#define VK_A 'A' +#define VK_B 'B' +#define VK_C 'C' +#define VK_D 'D' +#define VK_E 'E' +#define VK_F 'F' +#define VK_G 'G' +#define VK_H 'H' +#define VK_I 'I' +#define VK_J 'J' +#define VK_K 'K' +#define VK_L 'L' +#define VK_M 'M' +#define VK_N 'N' +#define VK_O 'O' +#define VK_P 'P' +#define VK_Q 'Q' +#define VK_R 'R' +#define VK_S 'S' +#define VK_T 'T' +#define VK_U 'U' +#define VK_V 'V' +#define VK_W 'W' +#define VK_X 'X' +#define VK_Y 'Y' +#define VK_Z 'Z' #endif /* VK_0 */ /* These keys haven't been defined, but were experimentally determined */ -#define VK_SEMICOLON 0xBA -#define VK_EQUALS 0xBB -#define VK_COMMA 0xBC -#define VK_MINUS 0xBD -#define VK_PERIOD 0xBE -#define VK_SLASH 0xBF -#define VK_GRAVE 0xC0 -#define VK_LBRACKET 0xDB -#define VK_BACKSLASH 0xDC -#define VK_RBRACKET 0xDD -#define VK_APOSTROPHE 0xDE -#define VK_BACKTICK 0xDF -#define VK_OEM_102 0xE2 +#define VK_SEMICOLON 0xBA +#define VK_EQUALS 0xBB +#define VK_COMMA 0xBC +#define VK_MINUS 0xBD +#define VK_PERIOD 0xBE +#define VK_SLASH 0xBF +#define VK_GRAVE 0xC0 +#define VK_LBRACKET 0xDB +#define VK_BACKSLASH 0xDC +#define VK_RBRACKET 0xDD +#define VK_APOSTROPHE 0xDE +#define VK_BACKTICK 0xDF +#define VK_OEM_102 0xE2 /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/windows/SDL_windowsclipboard.c b/src/video/windows/SDL_windowsclipboard.c index 4f0c87a81..3d1db4a41 100644 --- a/src/video/windows/SDL_windowsclipboard.c +++ b/src/video/windows/SDL_windowsclipboard.c @@ -77,15 +77,17 @@ WIN_SetClipboardText(_THIS, const char *text) hMem = GlobalAlloc(GMEM_MOVEABLE, size); if (hMem) { LPTSTR dst = (LPTSTR)GlobalLock(hMem); - /* Copy the text over, adding carriage returns as necessary */ - for (i = 0; tstr[i]; ++i) { - if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) { - *dst++ = '\r'; + if (dst) { + /* Copy the text over, adding carriage returns as necessary */ + for (i = 0; tstr[i]; ++i) { + if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) { + *dst++ = '\r'; + } + *dst++ = tstr[i]; } - *dst++ = tstr[i]; + *dst = 0; + GlobalUnlock(hMem); } - *dst = 0; - GlobalUnlock(hMem); EmptyClipboard(); if (!SetClipboardData(TEXT_FORMAT, hMem)) { @@ -137,7 +139,7 @@ WIN_HasClipboardText(_THIS) if (text) { result = (SDL_strlen(text)>0) ? SDL_TRUE : SDL_FALSE; SDL_free(text); - } + } return result; } diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index fc85e4493..acf8d5e51 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -33,10 +33,12 @@ /* Dropfile support */ #include +/* For GET_X_LPARAM, GET_Y_LPARAM. */ +#include /*#define WMMSG_DEBUG*/ #ifdef WMMSG_DEBUG -#include +#include #include "wmmsg.h" #endif @@ -46,7 +48,7 @@ #define VK_ENTER 10 /* Keypad Enter ... no VKEY defined? */ #ifndef VK_OEM_NEC_EQUAL -#define VK_OEM_NEC_EQUAL 0x92 +#define VK_OEM_NEC_EQUAL 0x92 #endif /* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */ @@ -66,192 +68,192 @@ #define WM_TOUCH 0x0240 #endif -static SDL_Scancode +static SDL_Scancode WindowsScanCodeToSDLScanCode( LPARAM lParam, WPARAM wParam ) { - SDL_Scancode code; - char bIsExtended; - int nScanCode = ( lParam >> 16 ) & 0xFF; + SDL_Scancode code; + char bIsExtended; + int nScanCode = ( lParam >> 16 ) & 0xFF; - /* 0x45 here to work around both pause and numlock sharing the same scancode, so use the VK key to tell them apart */ - if ( nScanCode == 0 || nScanCode == 0x45 ) - { - switch( wParam ) - { - case VK_CLEAR: return SDL_SCANCODE_CLEAR; - case VK_MODECHANGE: return SDL_SCANCODE_MODE; - case VK_SELECT: return SDL_SCANCODE_SELECT; - case VK_EXECUTE: return SDL_SCANCODE_EXECUTE; - case VK_HELP: return SDL_SCANCODE_HELP; - case VK_PAUSE: return SDL_SCANCODE_PAUSE; - case VK_NUMLOCK: return SDL_SCANCODE_NUMLOCKCLEAR; + /* 0x45 here to work around both pause and numlock sharing the same scancode, so use the VK key to tell them apart */ + if ( nScanCode == 0 || nScanCode == 0x45 ) + { + switch( wParam ) + { + case VK_CLEAR: return SDL_SCANCODE_CLEAR; + case VK_MODECHANGE: return SDL_SCANCODE_MODE; + case VK_SELECT: return SDL_SCANCODE_SELECT; + case VK_EXECUTE: return SDL_SCANCODE_EXECUTE; + case VK_HELP: return SDL_SCANCODE_HELP; + case VK_PAUSE: return SDL_SCANCODE_PAUSE; + case VK_NUMLOCK: return SDL_SCANCODE_NUMLOCKCLEAR; - case VK_F13: return SDL_SCANCODE_F13; - case VK_F14: return SDL_SCANCODE_F14; - case VK_F15: return SDL_SCANCODE_F15; - case VK_F16: return SDL_SCANCODE_F16; - case VK_F17: return SDL_SCANCODE_F17; - case VK_F18: return SDL_SCANCODE_F18; - case VK_F19: return SDL_SCANCODE_F19; - case VK_F20: return SDL_SCANCODE_F20; - case VK_F21: return SDL_SCANCODE_F21; - case VK_F22: return SDL_SCANCODE_F22; - case VK_F23: return SDL_SCANCODE_F23; - case VK_F24: return SDL_SCANCODE_F24; + case VK_F13: return SDL_SCANCODE_F13; + case VK_F14: return SDL_SCANCODE_F14; + case VK_F15: return SDL_SCANCODE_F15; + case VK_F16: return SDL_SCANCODE_F16; + case VK_F17: return SDL_SCANCODE_F17; + case VK_F18: return SDL_SCANCODE_F18; + case VK_F19: return SDL_SCANCODE_F19; + case VK_F20: return SDL_SCANCODE_F20; + case VK_F21: return SDL_SCANCODE_F21; + case VK_F22: return SDL_SCANCODE_F22; + case VK_F23: return SDL_SCANCODE_F23; + case VK_F24: return SDL_SCANCODE_F24; - case VK_OEM_NEC_EQUAL: return SDL_SCANCODE_KP_EQUALS; - case VK_BROWSER_BACK: return SDL_SCANCODE_AC_BACK; - case VK_BROWSER_FORWARD: return SDL_SCANCODE_AC_FORWARD; - case VK_BROWSER_REFRESH: return SDL_SCANCODE_AC_REFRESH; - case VK_BROWSER_STOP: return SDL_SCANCODE_AC_STOP; - case VK_BROWSER_SEARCH: return SDL_SCANCODE_AC_SEARCH; - case VK_BROWSER_FAVORITES: return SDL_SCANCODE_AC_BOOKMARKS; - case VK_BROWSER_HOME: return SDL_SCANCODE_AC_HOME; - case VK_VOLUME_MUTE: return SDL_SCANCODE_AUDIOMUTE; - case VK_VOLUME_DOWN: return SDL_SCANCODE_VOLUMEDOWN; - case VK_VOLUME_UP: return SDL_SCANCODE_VOLUMEUP; - - case VK_MEDIA_NEXT_TRACK: return SDL_SCANCODE_AUDIONEXT; - case VK_MEDIA_PREV_TRACK: return SDL_SCANCODE_AUDIOPREV; - case VK_MEDIA_STOP: return SDL_SCANCODE_AUDIOSTOP; - case VK_MEDIA_PLAY_PAUSE: return SDL_SCANCODE_AUDIOPLAY; - case VK_LAUNCH_MAIL: return SDL_SCANCODE_MAIL; - case VK_LAUNCH_MEDIA_SELECT: return SDL_SCANCODE_MEDIASELECT; - - case VK_OEM_102: return SDL_SCANCODE_NONUSBACKSLASH; + case VK_OEM_NEC_EQUAL: return SDL_SCANCODE_KP_EQUALS; + case VK_BROWSER_BACK: return SDL_SCANCODE_AC_BACK; + case VK_BROWSER_FORWARD: return SDL_SCANCODE_AC_FORWARD; + case VK_BROWSER_REFRESH: return SDL_SCANCODE_AC_REFRESH; + case VK_BROWSER_STOP: return SDL_SCANCODE_AC_STOP; + case VK_BROWSER_SEARCH: return SDL_SCANCODE_AC_SEARCH; + case VK_BROWSER_FAVORITES: return SDL_SCANCODE_AC_BOOKMARKS; + case VK_BROWSER_HOME: return SDL_SCANCODE_AC_HOME; + case VK_VOLUME_MUTE: return SDL_SCANCODE_AUDIOMUTE; + case VK_VOLUME_DOWN: return SDL_SCANCODE_VOLUMEDOWN; + case VK_VOLUME_UP: return SDL_SCANCODE_VOLUMEUP; - case VK_ATTN: return SDL_SCANCODE_SYSREQ; - case VK_CRSEL: return SDL_SCANCODE_CRSEL; - case VK_EXSEL: return SDL_SCANCODE_EXSEL; - case VK_OEM_CLEAR: return SDL_SCANCODE_CLEAR; + case VK_MEDIA_NEXT_TRACK: return SDL_SCANCODE_AUDIONEXT; + case VK_MEDIA_PREV_TRACK: return SDL_SCANCODE_AUDIOPREV; + case VK_MEDIA_STOP: return SDL_SCANCODE_AUDIOSTOP; + case VK_MEDIA_PLAY_PAUSE: return SDL_SCANCODE_AUDIOPLAY; + case VK_LAUNCH_MAIL: return SDL_SCANCODE_MAIL; + case VK_LAUNCH_MEDIA_SELECT: return SDL_SCANCODE_MEDIASELECT; - case VK_LAUNCH_APP1: return SDL_SCANCODE_APP1; - case VK_LAUNCH_APP2: return SDL_SCANCODE_APP2; + case VK_OEM_102: return SDL_SCANCODE_NONUSBACKSLASH; - default: return SDL_SCANCODE_UNKNOWN; - } - } + case VK_ATTN: return SDL_SCANCODE_SYSREQ; + case VK_CRSEL: return SDL_SCANCODE_CRSEL; + case VK_EXSEL: return SDL_SCANCODE_EXSEL; + case VK_OEM_CLEAR: return SDL_SCANCODE_CLEAR; - if ( nScanCode > 127 ) - return SDL_SCANCODE_UNKNOWN; + case VK_LAUNCH_APP1: return SDL_SCANCODE_APP1; + case VK_LAUNCH_APP2: return SDL_SCANCODE_APP2; - code = windows_scancode_table[nScanCode]; + default: return SDL_SCANCODE_UNKNOWN; + } + } - bIsExtended = ( lParam & ( 1 << 24 ) ) != 0; - if ( !bIsExtended ) - { - switch ( code ) - { - case SDL_SCANCODE_HOME: - return SDL_SCANCODE_KP_7; - case SDL_SCANCODE_UP: - return SDL_SCANCODE_KP_8; - case SDL_SCANCODE_PAGEUP: - return SDL_SCANCODE_KP_9; - case SDL_SCANCODE_LEFT: - return SDL_SCANCODE_KP_4; - case SDL_SCANCODE_RIGHT: - return SDL_SCANCODE_KP_6; - case SDL_SCANCODE_END: - return SDL_SCANCODE_KP_1; - case SDL_SCANCODE_DOWN: - return SDL_SCANCODE_KP_2; - case SDL_SCANCODE_PAGEDOWN: - return SDL_SCANCODE_KP_3; - case SDL_SCANCODE_INSERT: - return SDL_SCANCODE_KP_0; - case SDL_SCANCODE_DELETE: - return SDL_SCANCODE_KP_PERIOD; - case SDL_SCANCODE_PRINTSCREEN: - return SDL_SCANCODE_KP_MULTIPLY; - default: - break; - } - } - else - { - switch ( code ) - { - case SDL_SCANCODE_RETURN: - return SDL_SCANCODE_KP_ENTER; - case SDL_SCANCODE_LALT: - return SDL_SCANCODE_RALT; - case SDL_SCANCODE_LCTRL: - return SDL_SCANCODE_RCTRL; - case SDL_SCANCODE_SLASH: - return SDL_SCANCODE_KP_DIVIDE; - case SDL_SCANCODE_CAPSLOCK: - return SDL_SCANCODE_KP_PLUS; + if ( nScanCode > 127 ) + return SDL_SCANCODE_UNKNOWN; + + code = windows_scancode_table[nScanCode]; + + bIsExtended = ( lParam & ( 1 << 24 ) ) != 0; + if ( !bIsExtended ) + { + switch ( code ) + { + case SDL_SCANCODE_HOME: + return SDL_SCANCODE_KP_7; + case SDL_SCANCODE_UP: + return SDL_SCANCODE_KP_8; + case SDL_SCANCODE_PAGEUP: + return SDL_SCANCODE_KP_9; + case SDL_SCANCODE_LEFT: + return SDL_SCANCODE_KP_4; + case SDL_SCANCODE_RIGHT: + return SDL_SCANCODE_KP_6; + case SDL_SCANCODE_END: + return SDL_SCANCODE_KP_1; + case SDL_SCANCODE_DOWN: + return SDL_SCANCODE_KP_2; + case SDL_SCANCODE_PAGEDOWN: + return SDL_SCANCODE_KP_3; + case SDL_SCANCODE_INSERT: + return SDL_SCANCODE_KP_0; + case SDL_SCANCODE_DELETE: + return SDL_SCANCODE_KP_PERIOD; + case SDL_SCANCODE_PRINTSCREEN: + return SDL_SCANCODE_KP_MULTIPLY; default: break; - } - } + } + } + else + { + switch ( code ) + { + case SDL_SCANCODE_RETURN: + return SDL_SCANCODE_KP_ENTER; + case SDL_SCANCODE_LALT: + return SDL_SCANCODE_RALT; + case SDL_SCANCODE_LCTRL: + return SDL_SCANCODE_RCTRL; + case SDL_SCANCODE_SLASH: + return SDL_SCANCODE_KP_DIVIDE; + case SDL_SCANCODE_CAPSLOCK: + return SDL_SCANCODE_KP_PLUS; + default: + break; + } + } - return code; + return code; } -void +void WIN_CheckWParamMouseButton( SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button ) { - if ( bwParamMousePressed && !bSDLMousePressed ) - { - SDL_SendMouseButton(data->window, 0, SDL_PRESSED, button); - } - else if ( !bwParamMousePressed && bSDLMousePressed ) - { - SDL_SendMouseButton(data->window, 0, SDL_RELEASED, button); - } + if ( bwParamMousePressed && !bSDLMousePressed ) + { + SDL_SendMouseButton(data->window, 0, SDL_PRESSED, button); + } + else if ( !bwParamMousePressed && bSDLMousePressed ) + { + SDL_SendMouseButton(data->window, 0, SDL_RELEASED, button); + } } /* * Some windows systems fail to send a WM_LBUTTONDOWN sometimes, but each mouse move contains the current button state also * so this funciton reconciles our view of the world with the current buttons reported by windows */ -void +void WIN_CheckWParamMouseButtons( WPARAM wParam, SDL_WindowData *data ) { - if ( wParam != data->mouse_button_flags ) - { - Uint32 mouseFlags = SDL_GetMouseState( NULL, NULL ); - WIN_CheckWParamMouseButton( (wParam & MK_LBUTTON), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT ); - WIN_CheckWParamMouseButton( (wParam & MK_MBUTTON), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE ); - WIN_CheckWParamMouseButton( (wParam & MK_RBUTTON), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT ); - WIN_CheckWParamMouseButton( (wParam & MK_XBUTTON1), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 ); - WIN_CheckWParamMouseButton( (wParam & MK_XBUTTON2), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 ); - data->mouse_button_flags = wParam; - } + if ( wParam != data->mouse_button_flags ) + { + Uint32 mouseFlags = SDL_GetMouseState( NULL, NULL ); + WIN_CheckWParamMouseButton( (wParam & MK_LBUTTON), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT ); + WIN_CheckWParamMouseButton( (wParam & MK_MBUTTON), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE ); + WIN_CheckWParamMouseButton( (wParam & MK_RBUTTON), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT ); + WIN_CheckWParamMouseButton( (wParam & MK_XBUTTON1), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 ); + WIN_CheckWParamMouseButton( (wParam & MK_XBUTTON2), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 ); + data->mouse_button_flags = wParam; + } } -void +void WIN_CheckRawMouseButtons( ULONG rawButtons, SDL_WindowData *data ) { - if ( rawButtons != data->mouse_button_flags ) - { - Uint32 mouseFlags = SDL_GetMouseState( NULL, NULL ); - if ( (rawButtons & RI_MOUSE_BUTTON_1_DOWN) ) - WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_1_DOWN), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT ); - if ( (rawButtons & RI_MOUSE_BUTTON_1_UP) ) - WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_1_UP), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT ); - if ( (rawButtons & RI_MOUSE_BUTTON_2_DOWN) ) - WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_2_DOWN), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT ); - if ( (rawButtons & RI_MOUSE_BUTTON_2_UP) ) - WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_2_UP), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT ); - if ( (rawButtons & RI_MOUSE_BUTTON_3_DOWN) ) - WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_3_DOWN), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE ); - if ( (rawButtons & RI_MOUSE_BUTTON_3_UP) ) - WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_3_UP), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE ); - if ( (rawButtons & RI_MOUSE_BUTTON_4_DOWN) ) - WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_4_DOWN), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 ); - if ( (rawButtons & RI_MOUSE_BUTTON_4_UP) ) - WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_4_UP), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 ); - if ( (rawButtons & RI_MOUSE_BUTTON_5_DOWN) ) - WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_5_DOWN), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 ); - if ( (rawButtons & RI_MOUSE_BUTTON_5_UP) ) - WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_5_UP), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 ); - data->mouse_button_flags = rawButtons; - } + if ( rawButtons != data->mouse_button_flags ) + { + Uint32 mouseFlags = SDL_GetMouseState( NULL, NULL ); + if ( (rawButtons & RI_MOUSE_BUTTON_1_DOWN) ) + WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_1_DOWN), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT ); + if ( (rawButtons & RI_MOUSE_BUTTON_1_UP) ) + WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_1_UP), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT ); + if ( (rawButtons & RI_MOUSE_BUTTON_2_DOWN) ) + WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_2_DOWN), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT ); + if ( (rawButtons & RI_MOUSE_BUTTON_2_UP) ) + WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_2_UP), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT ); + if ( (rawButtons & RI_MOUSE_BUTTON_3_DOWN) ) + WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_3_DOWN), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE ); + if ( (rawButtons & RI_MOUSE_BUTTON_3_UP) ) + WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_3_UP), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE ); + if ( (rawButtons & RI_MOUSE_BUTTON_4_DOWN) ) + WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_4_DOWN), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 ); + if ( (rawButtons & RI_MOUSE_BUTTON_4_UP) ) + WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_4_UP), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 ); + if ( (rawButtons & RI_MOUSE_BUTTON_5_DOWN) ) + WIN_CheckWParamMouseButton( (rawButtons & RI_MOUSE_BUTTON_5_DOWN), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 ); + if ( (rawButtons & RI_MOUSE_BUTTON_5_UP) ) + WIN_CheckWParamMouseButton( !(rawButtons & RI_MOUSE_BUTTON_5_UP), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 ); + data->mouse_button_flags = rawButtons; + } } LRESULT CALLBACK @@ -280,8 +282,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } #ifdef WMMSG_DEBUG - { - FILE *log = fopen("wmmsg.txt", "a"); + { + FILE *log = fopen("wmmsg.txt", "a"); fprintf(log, "Received windows message: %p ", hwnd); if (msg > MAX_WMMSG) { fprintf(log, "%d", msg); @@ -314,8 +316,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) minimized = HIWORD(wParam); if (!minimized && (LOWORD(wParam) != WA_INACTIVE)) { - Uint32 mouseFlags; - SHORT keyState; + Uint32 mouseFlags; + SHORT keyState; SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0); SDL_SendWindowEvent(data->window, @@ -327,40 +329,40 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (SDL_GetKeyboardFocus() != data->window) { SDL_SetKeyboardFocus(data->window); } - /* mouse buttons may have changed state here, we need - to resync them, but we will get a WM_MOUSEMOVE right away which will fix - things up if in non raw mode also - */ - mouseFlags = SDL_GetMouseState( NULL, NULL ); + /* mouse buttons may have changed state here, we need + to resync them, but we will get a WM_MOUSEMOVE right away which will fix + things up if in non raw mode also + */ + mouseFlags = SDL_GetMouseState( NULL, NULL ); - keyState = GetAsyncKeyState( VK_LBUTTON ); - WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT ); - keyState = GetAsyncKeyState( VK_RBUTTON ); - WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT ); - keyState = GetAsyncKeyState( VK_MBUTTON ); - WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE ); - keyState = GetAsyncKeyState( VK_XBUTTON1 ); - WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 ); - keyState = GetAsyncKeyState( VK_XBUTTON2 ); - WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 ); - data->mouse_button_flags = 0; + keyState = GetAsyncKeyState( VK_LBUTTON ); + WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT ); + keyState = GetAsyncKeyState( VK_RBUTTON ); + WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT ); + keyState = GetAsyncKeyState( VK_MBUTTON ); + WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE ); + keyState = GetAsyncKeyState( VK_XBUTTON1 ); + WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 ); + keyState = GetAsyncKeyState( VK_XBUTTON2 ); + WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 ); + data->mouse_button_flags = 0; - if(SDL_GetMouse()->relative_mode) { - LONG cx, cy; - RECT rect; - GetWindowRect(hwnd, &rect); + if(SDL_GetMouse()->relative_mode) { + LONG cx, cy; + RECT rect; + GetWindowRect(hwnd, &rect); - cx = (rect.left + rect.right) / 2; - cy = (rect.top + rect.bottom) / 2; + cx = (rect.left + rect.right) / 2; + cy = (rect.top + rect.bottom) / 2; - /* Make an absurdly small clip rect */ - rect.left = cx-1; - rect.right = cx+1; - rect.top = cy-1; - rect.bottom = cy+1; + /* Make an absurdly small clip rect */ + rect.left = cx-1; + rect.right = cx+1; + rect.top = cy-1; + rect.bottom = cy+1; - ClipCursor(&rect); - } + ClipCursor(&rect); + } /* * FIXME: Update keyboard state @@ -379,65 +381,65 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) returnCode = 0; break; - case WM_MOUSEMOVE: - if( !SDL_GetMouse()->relative_mode ) - SDL_SendMouseMotion(data->window, 0, 0, LOWORD(lParam), HIWORD(lParam)); - /* don't break here, fall through to check the wParam like the button presses */ - case WM_LBUTTONUP: - case WM_RBUTTONUP: - case WM_MBUTTONUP: - case WM_XBUTTONUP: - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_XBUTTONDOWN: - if( !SDL_GetMouse()->relative_mode ) - WIN_CheckWParamMouseButtons( wParam, data ); - break; + case WM_MOUSEMOVE: + if( !SDL_GetMouse()->relative_mode ) + SDL_SendMouseMotion(data->window, 0, 0, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); + /* don't break here, fall through to check the wParam like the button presses */ + case WM_LBUTTONUP: + case WM_RBUTTONUP: + case WM_MBUTTONUP: + case WM_XBUTTONUP: + case WM_LBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_XBUTTONDOWN: + if( !SDL_GetMouse()->relative_mode ) + WIN_CheckWParamMouseButtons( wParam, data ); + break; - case WM_INPUT: - { - HRAWINPUT hRawInput = (HRAWINPUT)lParam; - RAWINPUT inp; - UINT size = sizeof(inp); + case WM_INPUT: + { + HRAWINPUT hRawInput = (HRAWINPUT)lParam; + RAWINPUT inp; + UINT size = sizeof(inp); - if(!SDL_GetMouse()->relative_mode) - break; + if(!SDL_GetMouse()->relative_mode) + break; - GetRawInputData(hRawInput, RID_INPUT, &inp, &size, sizeof(RAWINPUTHEADER)); + GetRawInputData(hRawInput, RID_INPUT, &inp, &size, sizeof(RAWINPUTHEADER)); - /* Mouse data */ - if(inp.header.dwType == RIM_TYPEMOUSE) - { - RAWMOUSE* mouse = &inp.data.mouse; + /* Mouse data */ + if(inp.header.dwType == RIM_TYPEMOUSE) + { + RAWMOUSE* mouse = &inp.data.mouse; - if((mouse->usFlags & 0x01) == MOUSE_MOVE_RELATIVE) - { - SDL_SendMouseMotion(data->window, 0, 1, (int)mouse->lLastX, (int)mouse->lLastY); - } - else - { - // synthesize relative moves from the abs position - static SDL_Point initialMousePoint; - if ( initialMousePoint.x == 0 && initialMousePoint.y == 0 ) - { - initialMousePoint.x = mouse->lLastX; - initialMousePoint.y = mouse->lLastY; - } + if((mouse->usFlags & 0x01) == MOUSE_MOVE_RELATIVE) + { + SDL_SendMouseMotion(data->window, 0, 1, (int)mouse->lLastX, (int)mouse->lLastY); + } + else + { + /* synthesize relative moves from the abs position */ + static SDL_Point initialMousePoint; + if ( initialMousePoint.x == 0 && initialMousePoint.y == 0 ) + { + initialMousePoint.x = mouse->lLastX; + initialMousePoint.y = mouse->lLastY; + } - SDL_SendMouseMotion(data->window, 0, 1, (int)(mouse->lLastX-initialMousePoint.x), (int)(mouse->lLastY-initialMousePoint.y) ); + SDL_SendMouseMotion(data->window, 0, 1, (int)(mouse->lLastX-initialMousePoint.x), (int)(mouse->lLastY-initialMousePoint.y) ); - initialMousePoint.x = mouse->lLastX; - initialMousePoint.y = mouse->lLastY; - } - WIN_CheckRawMouseButtons( mouse->usButtonFlags, data ); - } - break; - } + initialMousePoint.x = mouse->lLastX; + initialMousePoint.y = mouse->lLastY; + } + WIN_CheckRawMouseButtons( mouse->usButtonFlags, data ); + } + break; + } case WM_MOUSEWHEEL: { - // FIXME: This may need to accumulate deltas up to WHEEL_DELTA + /* FIXME: This may need to accumulate deltas up to WHEEL_DELTA */ short motion = GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; SDL_SendMouseWheel(data->window, 0, 0, motion); @@ -445,9 +447,12 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } #ifdef WM_MOUSELEAVE - /* FIXME: Do we need the SDL 1.2 hack to generate WM_MOUSELEAVE now? */ case WM_MOUSELEAVE: - if (SDL_GetMouseFocus() == data->window) { + if (SDL_GetMouseFocus() == data->window && !SDL_GetMouse()->relative_mode) { + POINT cursorPos; + GetCursorPos(&cursorPos); + ScreenToClient(hwnd, &cursorPos); + SDL_SendMouseMotion(data->window, 0, 0, cursorPos.x, cursorPos.y); SDL_SetMouseFocus(NULL); } returnCode = 0; @@ -457,8 +462,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_SYSKEYDOWN: case WM_KEYDOWN: { - SDL_Scancode code = WindowsScanCodeToSDLScanCode( lParam, wParam ); - if ( code != SDL_SCANCODE_UNKNOWN ) { + SDL_Scancode code = WindowsScanCodeToSDLScanCode( lParam, wParam ); + if ( code != SDL_SCANCODE_UNKNOWN ) { SDL_SendKeyboardKey(SDL_PRESSED, code ); } } @@ -523,7 +528,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int max_w, max_h; int style; BOOL menu; - BOOL constrain_max_size; + BOOL constrain_max_size; /* If we allow resizing, let the resize happen naturally */ if (SDL_IsShapedWindow(data->window)) @@ -539,7 +544,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SDL_GetWindowMinimumSize(data->window, &min_w, &min_h); SDL_GetWindowMaximumSize(data->window, &max_w, &max_h); - /* Store in min_w and min_h difference between current size and minimal + /* Store in min_w and min_h difference between current size and minimal size so we don't need to call AdjustWindowRectEx twice */ min_w -= w; min_h -= h; @@ -639,7 +644,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { RECT rect; if (GetUpdateRect(hwnd, &rect, FALSE)) { - ValidateRect(hwnd, &rect); + ValidateRect(hwnd, NULL); SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_EXPOSED, 0, 0); } @@ -674,56 +679,59 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) returnCode = 0; break; - case WM_TOUCH: - { - UINT i, num_inputs = LOWORD(wParam); - PTOUCHINPUT inputs = SDL_stack_alloc(TOUCHINPUT, num_inputs); - if (data->videodata->GetTouchInputInfo((HTOUCHINPUT)lParam, num_inputs, inputs, sizeof(TOUCHINPUT))) { - RECT rect; - float x, y; + case WM_TOUCH: + { + UINT i, num_inputs = LOWORD(wParam); + PTOUCHINPUT inputs = SDL_stack_alloc(TOUCHINPUT, num_inputs); + if (data->videodata->GetTouchInputInfo((HTOUCHINPUT)lParam, num_inputs, inputs, sizeof(TOUCHINPUT))) { + RECT rect; + float x, y; - if (!GetClientRect(hwnd, &rect) || - (rect.right == rect.left && rect.bottom == rect.top)) { - break; - } - ClientToScreen(hwnd, (LPPOINT) & rect); - ClientToScreen(hwnd, (LPPOINT) & rect + 1); - rect.top *= 100; - rect.left *= 100; - rect.bottom *= 100; - rect.right *= 100; + if (!GetClientRect(hwnd, &rect) || + (rect.right == rect.left && rect.bottom == rect.top)) { + if (inputs) { + SDL_stack_free(inputs); + } + break; + } + ClientToScreen(hwnd, (LPPOINT) & rect); + ClientToScreen(hwnd, (LPPOINT) & rect + 1); + rect.top *= 100; + rect.left *= 100; + rect.bottom *= 100; + rect.right *= 100; - for (i = 0; i < num_inputs; ++i) { - PTOUCHINPUT input = &inputs[i]; + for (i = 0; i < num_inputs; ++i) { + PTOUCHINPUT input = &inputs[i]; - const SDL_TouchID touchId = (SDL_TouchID)input->hSource; - if (!SDL_GetTouch(touchId)) { - if (SDL_AddTouch(touchId, "") < 0) { - continue; - } - } + const SDL_TouchID touchId = (SDL_TouchID)((size_t)input->hSource); + if (!SDL_GetTouch(touchId)) { + if (SDL_AddTouch(touchId, "") < 0) { + continue; + } + } - // Get the normalized coordinates for the window - x = (float)(input->x - rect.left)/(rect.right - rect.left); - y = (float)(input->y - rect.top)/(rect.bottom - rect.top); + /* Get the normalized coordinates for the window */ + x = (float)(input->x - rect.left)/(rect.right - rect.left); + y = (float)(input->y - rect.top)/(rect.bottom - rect.top); - if (input->dwFlags & TOUCHEVENTF_DOWN) { - SDL_SendTouch(touchId, input->dwID, SDL_TRUE, x, y, 1.0f); - } - if (input->dwFlags & TOUCHEVENTF_MOVE) { - SDL_SendTouchMotion(touchId, input->dwID, x, y, 1.0f); - } - if (input->dwFlags & TOUCHEVENTF_UP) { - SDL_SendTouch(touchId, input->dwID, SDL_FALSE, x, y, 1.0f); - } - } - } - SDL_stack_free(inputs); + if (input->dwFlags & TOUCHEVENTF_DOWN) { + SDL_SendTouch(touchId, input->dwID, SDL_TRUE, x, y, 1.0f); + } + if (input->dwFlags & TOUCHEVENTF_MOVE) { + SDL_SendTouchMotion(touchId, input->dwID, x, y, 1.0f); + } + if (input->dwFlags & TOUCHEVENTF_UP) { + SDL_SendTouch(touchId, input->dwID, SDL_FALSE, x, y, 1.0f); + } + } + } + SDL_stack_free(inputs); - data->videodata->CloseTouchInputHandle((HTOUCHINPUT)lParam); - return 0; - } - break; + data->videodata->CloseTouchInputHandle((HTOUCHINPUT)lParam); + return 0; + } + break; case WM_DROPFILES: { @@ -761,11 +769,24 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) void WIN_PumpEvents(_THIS) { + const Uint8 *keystate; MSG msg; while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } + + /* Windows loses a shift KEYUP event when you have both pressed at once and let go of one. + You won't get a KEYUP until both are released, and that keyup will only be for the second + key you released. Take heroic measures and check the keystate as of the last handled event, + and if we think a key is pressed when Windows doesn't, unstick it in SDL's state. */ + keystate = SDL_GetKeyboardState(NULL); + if ((keystate[SDL_SCANCODE_LSHIFT] == SDL_PRESSED) && !(GetKeyState(VK_LSHIFT) & 0x8000)) { + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT); + } + if ((keystate[SDL_SCANCODE_RSHIFT] == SDL_PRESSED) && !(GetKeyState(VK_RSHIFT) & 0x8000)) { + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RSHIFT); + } } static int app_registered = 0; diff --git a/src/video/windows/SDL_windowsframebuffer.c b/src/video/windows/SDL_windowsframebuffer.c index 5a2a9ef00..93af4c5e8 100644 --- a/src/video/windows/SDL_windowsframebuffer.c +++ b/src/video/windows/SDL_windowsframebuffer.c @@ -77,7 +77,7 @@ int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, voi /* Fill in the size information */ *pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3); info->bmiHeader.biWidth = window->w; - info->bmiHeader.biHeight = -window->h; /* negative for topdown bitmap */ + info->bmiHeader.biHeight = -window->h; /* negative for topdown bitmap */ info->bmiHeader.biSizeImage = window->h * (*pitch); data->mdc = CreateCompatibleDC(data->hdc); diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 74f078f86..de5848043 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -187,12 +187,12 @@ void WIN_SetTextInputRect(_THIS, SDL_Rect *rect) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; - + if (!rect) { SDL_InvalidParamError("rect"); return; } - + videodata->ime_rect = *rect; } @@ -466,8 +466,10 @@ IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd) s = (WCHAR *)(p + 1*4 + (16*2+2*4) + 5*4); break; } - if (s) - SDL_wcslcpy(videodata->ime_readingstring, s, len + 1); + if (s) { + size_t size = SDL_min((size_t)(len + 1), SDL_arraysize(videodata->ime_readingstring)); + SDL_wcslcpy(videodata->ime_readingstring, s, size); + } videodata->ImmUnlockIMCC(lpimc->hPrivate); videodata->ImmUnlockIMC(himc); @@ -673,13 +675,13 @@ IME_ClearComposition(SDL_VideoData *videodata) static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string) { - LONG length = ImmGetCompositionStringW(himc, string, videodata->ime_composition, sizeof(videodata->ime_composition)); + LONG length = ImmGetCompositionStringW(himc, string, videodata->ime_composition, sizeof(videodata->ime_composition) - sizeof(videodata->ime_composition[0])); if (length < 0) length = 0; length /= sizeof(videodata->ime_composition[0]); videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0)); - if (videodata->ime_composition[videodata->ime_cursor] == 0x3000) { + if (videodata->ime_cursor < SDL_arraysize(videodata->ime_composition) && videodata->ime_composition[videodata->ime_cursor] == 0x3000) { int i; for (i = videodata->ime_cursor + 1; i < length; ++i) videodata->ime_composition[i - 1] = videodata->ime_composition[i]; @@ -707,15 +709,16 @@ IME_SendEditingEvent(SDL_VideoData *videodata) { char *s = 0; WCHAR buffer[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; + const size_t size = SDL_arraysize(buffer); buffer[0] = 0; if (videodata->ime_readingstring[0]) { size_t len = SDL_min(SDL_wcslen(videodata->ime_composition), (size_t)videodata->ime_cursor); SDL_wcslcpy(buffer, videodata->ime_composition, len + 1); - SDL_wcslcat(buffer, videodata->ime_readingstring, sizeof(buffer)); - SDL_wcslcat(buffer, &videodata->ime_composition[len], sizeof(buffer) - len); + SDL_wcslcat(buffer, videodata->ime_readingstring, size); + SDL_wcslcat(buffer, &videodata->ime_composition[len], size); } else { - SDL_wcslcpy(buffer, videodata->ime_composition, sizeof(videodata->ime_composition)); + SDL_wcslcpy(buffer, videodata->ime_composition, size); } s = WIN_StringToUTF8(buffer); SDL_SendEditingText(s, videodata->ime_cursor + SDL_wcslen(videodata->ime_readingstring), 0); @@ -1031,7 +1034,7 @@ STDMETHODIMP UIElementSink_BeginUIElement(TSFSink *sink, DWORD dwUIElementId, BO } preading->lpVtbl->Release(preading); } - else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { + else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { videodata->ime_candref++; UILess_GetCandidateList(videodata, pcandlist); pcandlist->lpVtbl->Release(pcandlist); @@ -1052,13 +1055,13 @@ STDMETHODIMP UIElementSink_UpdateUIElement(TSFSink *sink, DWORD dwUIElementId) BSTR bstr; if (SUCCEEDED(preading->lpVtbl->GetString(preading, &bstr)) && bstr) { WCHAR *s = (WCHAR *)bstr; - SDL_wcslcpy(videodata->ime_readingstring, s, sizeof(videodata->ime_readingstring)); + SDL_wcslcpy(videodata->ime_readingstring, s, SDL_arraysize(videodata->ime_readingstring)); IME_SendEditingEvent(videodata); SysFreeString(bstr); } preading->lpVtbl->Release(preading); } - else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { + else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { UILess_GetCandidateList(videodata, pcandlist); pcandlist->lpVtbl->Release(pcandlist); } @@ -1351,7 +1354,6 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) SIZE candsizes[MAX_CANDLIST]; SIZE maxcandsize = {0}; HBITMAP hbm = NULL; - BYTE *bits = NULL; const int candcount = SDL_min(SDL_min(MAX_CANDLIST, videodata->ime_candcount), videodata->ime_candpgsize); SDL_bool vertical = videodata->ime_candvertical; @@ -1433,7 +1435,7 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) ; } - bits = StartDrawToBitmap(hdc, &hbm, size.cx, size.cy); + StartDrawToBitmap(hdc, &hbm, size.cx, size.cy); SelectObject(hdc, listpen); SelectObject(hdc, listbrush); @@ -1512,7 +1514,7 @@ void IME_Present(SDL_VideoData *videodata) if (videodata->ime_dirty) IME_Render(videodata); - // FIXME: Need to show the IME bitmap + /* FIXME: Need to show the IME bitmap */ } #endif /* SDL_DISABLE_WINDOWS_IME */ diff --git a/src/video/windows/SDL_windowsmessagebox.c b/src/video/windows/SDL_windowsmessagebox.c index 18504cb3c..bbe79237f 100644 --- a/src/video/windows/SDL_windowsmessagebox.c +++ b/src/video/windows/SDL_windowsmessagebox.c @@ -36,28 +36,28 @@ typedef struct { - WORD dlgVer; - WORD signature; - DWORD helpID; - DWORD exStyle; - DWORD style; - WORD cDlgItems; - short x; - short y; - short cx; - short cy; + WORD dlgVer; + WORD signature; + DWORD helpID; + DWORD exStyle; + DWORD style; + WORD cDlgItems; + short x; + short y; + short cx; + short cy; } DLGTEMPLATEEX; typedef struct { - DWORD helpID; - DWORD exStyle; - DWORD style; - short x; - short y; - short cx; - short cy; - DWORD id; + DWORD helpID; + DWORD exStyle; + DWORD style; + short x; + short y; + short cx; + short cy; + DWORD id; } DLGITEMTEMPLATEEX; #pragma pack(pop) @@ -76,7 +76,7 @@ static INT_PTR MessageBoxDialogProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPA switch ( iMessage ) { case WM_COMMAND: /* Return the ID of the button that was pushed */ - EndDialog(hDlg, LOWORD(wParam)); + EndDialog(hDlg, LOWORD(wParam)); return TRUE; default: @@ -108,7 +108,7 @@ static SDL_bool ExpandDialogSpace(WIN_DialogData *dialog, size_t space) } return SDL_TRUE; } - + static SDL_bool AlignDialogData(WIN_DialogData *dialog, size_t size) { size_t padding = (dialog->used % size); @@ -166,7 +166,7 @@ static int s_BaseUnitsX; static int s_BaseUnitsY; static void Vec2ToDLU(short *x, short *y) { - SDL_assert(s_BaseUnitsX != 0); // we init in WIN_ShowMessageBox(), which is the only public function... + SDL_assert(s_BaseUnitsX != 0); /* we init in WIN_ShowMessageBox(), which is the only public function... */ *x = MulDiv(*x, 4, s_BaseUnitsX); *y = MulDiv(*y, 8, s_BaseUnitsY); @@ -265,37 +265,37 @@ static WIN_DialogData *CreateDialogData(int w, int h, const char *caption) return NULL; } - // No menu + /* No menu */ WordToPass = 0; if (!AddDialogData(dialog, &WordToPass, 2)) { FreeDialogData(dialog); return NULL; } - // No custom class + /* No custom class */ if (!AddDialogData(dialog, &WordToPass, 2)) { FreeDialogData(dialog); return NULL; } - // title + /* title */ if (!AddDialogString(dialog, caption)) { FreeDialogData(dialog); return NULL; } - // Font stuff + /* Font stuff */ { - // - // We want to use the system messagebox font. - // + /* + * We want to use the system messagebox font. + */ BYTE ToPass; - + NONCLIENTMETRICSA NCM; NCM.cbSize = sizeof(NCM); SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &NCM, 0); - - // Font size - convert to logical font size for dialog parameter. + + /* Font size - convert to logical font size for dialog parameter. */ { HDC ScreenDC = GetDC(0); WordToPass = (WORD)(-72 * NCM.lfMessageFont.lfHeight / GetDeviceCaps(ScreenDC, LOGPIXELSY)); @@ -307,28 +307,28 @@ static WIN_DialogData *CreateDialogData(int w, int h, const char *caption) return NULL; } - // Font weight + /* Font weight */ WordToPass = (WORD)NCM.lfMessageFont.lfWeight; if (!AddDialogData(dialog, &WordToPass, 2)) { FreeDialogData(dialog); return NULL; } - // italic? + /* italic? */ ToPass = NCM.lfMessageFont.lfItalic; if (!AddDialogData(dialog, &ToPass, 1)) { FreeDialogData(dialog); return NULL; } - // charset? + /* charset? */ ToPass = NCM.lfMessageFont.lfCharSet; if (!AddDialogData(dialog, &ToPass, 1)) { FreeDialogData(dialog); return NULL; } - // font typeface. + /* font typeface. */ if (!AddDialogString(dialog, NCM.lfMessageFont.lfFaceName)) { FreeDialogData(dialog); return NULL; @@ -355,44 +355,44 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) const int ButtonHeight = 26; const int TextMargin = 16; const int ButtonMargin = 12; - - // Jan 25th, 2013 - dant@fleetsa.com - // - // - // I've tried to make this more reasonable, but I've run in to a lot - // of nonsense. - // - // The original issue is the code was written in pixels and not - // dialog units (DLUs). All DialogBox functions use DLUs, which - // vary based on the selected font (yay). - // - // According to MSDN, the most reliable way to convert is via - // MapDialogUnits, which requires an HWND, which we don't have - // at time of template creation. - // - // We do however have: - // The system font (DLU width 8 for me) - // The font we select for the dialog (DLU width 6 for me) - // - // Based on experimentation, *neither* of these return the value - // actually used. Stepping in to MapDialogUnits(), the conversion - // is fairly clear, and uses 7 for me. - // - // As a result, some of this is hacky to ensure the sizing is - // somewhat correct. - // - // Honestly, a long term solution is to use CreateWindow, not CreateDialog. - // - // - // In order to get text dimensions we need to have a DC with the desired font. - // I'm assuming a dialog box in SDL is rare enough we can to the create. - // + /* Jan 25th, 2013 - dant@fleetsa.com + * + * + * I've tried to make this more reasonable, but I've run in to a lot + * of nonsense. + * + * The original issue is the code was written in pixels and not + * dialog units (DLUs). All DialogBox functions use DLUs, which + * vary based on the selected font (yay). + * + * According to MSDN, the most reliable way to convert is via + * MapDialogUnits, which requires an HWND, which we don't have + * at time of template creation. + * + * We do however have: + * The system font (DLU width 8 for me) + * The font we select for the dialog (DLU width 6 for me) + * + * Based on experimentation, *neither* of these return the value + * actually used. Stepping in to MapDialogUnits(), the conversion + * is fairly clear, and uses 7 for me. + * + * As a result, some of this is hacky to ensure the sizing is + * somewhat correct. + * + * Honestly, a long term solution is to use CreateWindow, not CreateDialog. + * + + * + * In order to get text dimensions we need to have a DC with the desired font. + * I'm assuming a dialog box in SDL is rare enough we can to the create. + */ HDC FontDC = CreateCompatibleDC(0); - + { - // Create a duplicate of the font used in system message boxes. + /* Create a duplicate of the font used in system message boxes. */ LOGFONT lf; NONCLIENTMETRICS NCM; NCM.cbSize = sizeof(NCM); @@ -401,40 +401,40 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) DialogFont = CreateFontIndirect(&lf); } - // Select the font in to our DC + /* Select the font in to our DC */ SelectObject(FontDC, DialogFont); { - // Get the metrics to try and figure our DLU conversion. + /* Get the metrics to try and figure our DLU conversion. */ GetTextMetrics(FontDC, &TM); s_BaseUnitsX = TM.tmAveCharWidth + 1; s_BaseUnitsY = TM.tmHeight; } - - // Measure the *pixel* size of the string. + + /* Measure the *pixel* size of the string. */ wmessage = WIN_UTF8ToString(messageboxdata->message); SDL_zero(TextSize); Size.cx = DrawText(FontDC, wmessage, -1, &TextSize, DT_CALCRECT); - // Add some padding for hangs, etc. + /* Add some padding for hangs, etc. */ TextSize.right += 2; TextSize.bottom += 2; - // Done with the DC, and the string + /* Done with the DC, and the string */ DeleteDC(FontDC); SDL_free(wmessage); - // Increase the size of the dialog by some border spacing around the text. + /* Increase the size of the dialog by some border spacing around the text. */ Size.cx = TextSize.right - TextSize.left; Size.cy = TextSize.bottom - TextSize.top; Size.cx += TextMargin * 2; Size.cy += TextMargin * 2; - // Ensure the size is wide enough for all of the buttons. + /* Ensure the size is wide enough for all of the buttons. */ if (Size.cx < messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin) Size.cx = messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin; - // Add vertical space for the buttons and border. + /* Add vertical space for the buttons and border. */ Size.cy += ButtonHeight + TextMargin; dialog = CreateDialogData(Size.cx, Size.cy, messageboxdata->title); @@ -447,7 +447,7 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) return -1; } - // Align the buttons to the right/bottom. + /* Align the buttons to the right/bottom. */ x = Size.cx - ButtonWidth - ButtonMargin; y = Size.cy - ButtonHeight - ButtonMargin; for (i = 0; i < messageboxdata->numbuttons; ++i) { diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index 97ddc736d..73cae8f37 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -245,6 +245,7 @@ WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display) } if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) { /* We don't support palettized modes now */ + SDL_free(mode.driverdata); continue; } if (mode.format != SDL_PIXELFORMAT_UNKNOWN) { @@ -252,6 +253,9 @@ WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display) SDL_free(mode.driverdata); } } + else { + SDL_free(mode.driverdata); + } } } diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 23f288b19..f50a8724b 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/src/video/windows/SDL_windowsmouse.c @@ -49,11 +49,16 @@ WIN_CreateDefaultCursor() static SDL_Cursor * WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) { + /* msdn says cursor mask has to be padded out to word alignment. Not sure + if that means machine word or WORD, but this handles either case. */ + const size_t pad = (sizeof (size_t) * 8); /* 32 or 64, or whatever. */ SDL_Cursor *cursor; HICON hicon; HDC hdc; BITMAPV4HEADER bmh; LPVOID pixels; + LPVOID maskbits; + size_t maskbitslen; ICONINFO ii; SDL_zero(bmh); @@ -68,14 +73,25 @@ WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) bmh.bV4GreenMask = 0x0000FF00; bmh.bV4BlueMask = 0x000000FF; + maskbitslen = ((surface->w + (pad - (surface->w % pad))) / 8) * surface->h; + maskbits = SDL_stack_alloc(Uint8,maskbitslen); + if (maskbits == NULL) { + SDL_OutOfMemory(); + return NULL; + } + + /* AND the cursor against full bits: no change. We already have alpha. */ + SDL_memset(maskbits, 0xFF, maskbitslen); + hdc = GetDC(NULL); SDL_zero(ii); ii.fIcon = FALSE; ii.xHotspot = (DWORD)hot_x; ii.yHotspot = (DWORD)hot_y; ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO*)&bmh, DIB_RGB_COLORS, &pixels, NULL, 0); - ii.hbmMask = CreateBitmap(surface->w, surface->h, 1, 1, NULL); + ii.hbmMask = CreateBitmap(surface->w, surface->h, 1, 1, maskbits); ReleaseDC(NULL, hdc); + SDL_stack_free(maskbits); SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); SDL_assert(surface->pitch == surface->w * 4); @@ -180,44 +196,44 @@ static int WIN_SetRelativeMouseMode(SDL_bool enabled) { RAWINPUTDEVICE rawMouse = { 0x01, 0x02, 0, NULL }; /* Mouse: UsagePage = 1, Usage = 2 */ - HWND hWnd; - hWnd = GetActiveWindow(); + HWND hWnd; + hWnd = GetActiveWindow(); - rawMouse.hwndTarget = hWnd; - if(!enabled) { - rawMouse.dwFlags |= RIDEV_REMOVE; - rawMouse.hwndTarget = NULL; - } + rawMouse.hwndTarget = hWnd; + if(!enabled) { + rawMouse.dwFlags |= RIDEV_REMOVE; + rawMouse.hwndTarget = NULL; + } - /* (Un)register raw input for mice */ - if(RegisterRawInputDevices(&rawMouse, 1, sizeof(RAWINPUTDEVICE)) == FALSE) { + /* (Un)register raw input for mice */ + if(RegisterRawInputDevices(&rawMouse, 1, sizeof(RAWINPUTDEVICE)) == FALSE) { - /* Only return an error when registering. If we unregister and fail, then - it's probably that we unregistered twice. That's OK. */ - if(enabled) { - return SDL_Unsupported(); - } - } + /* Only return an error when registering. If we unregister and fail, then + it's probably that we unregistered twice. That's OK. */ + if(enabled) { + return SDL_Unsupported(); + } + } - if(enabled) { - LONG cx, cy; - RECT rect; - GetWindowRect(hWnd, &rect); + if(enabled) { + LONG cx, cy; + RECT rect; + GetWindowRect(hWnd, &rect); - cx = (rect.left + rect.right) / 2; - cy = (rect.top + rect.bottom) / 2; + cx = (rect.left + rect.right) / 2; + cy = (rect.top + rect.bottom) / 2; - /* Make an absurdly small clip rect */ - rect.left = cx-1; - rect.right = cx+1; - rect.top = cy-1; - rect.bottom = cy+1; + /* Make an absurdly small clip rect */ + rect.left = cx-1; + rect.right = cx+1; + rect.top = cy-1; + rect.bottom = cy+1; - ClipCursor(&rect); - } - else - ClipCursor(NULL); + ClipCursor(&rect); + } + else + ClipCursor(NULL); return 0; } @@ -228,7 +244,7 @@ WIN_InitMouse(_THIS) SDL_Mouse *mouse = SDL_GetMouse(); mouse->CreateCursor = WIN_CreateCursor; - mouse->CreateSystemCursor = WIN_CreateSystemCursor; + mouse->CreateSystemCursor = WIN_CreateSystemCursor; mouse->ShowCursor = WIN_ShowCursor; mouse->FreeCursor = WIN_FreeCursor; mouse->WarpMouse = WIN_WarpMouse; @@ -240,6 +256,12 @@ WIN_InitMouse(_THIS) void WIN_QuitMouse(_THIS) { + SDL_Mouse *mouse = SDL_GetMouse(); + if ( mouse->def_cursor ) { + SDL_free(mouse->def_cursor); + mouse->def_cursor = NULL; + mouse->cur_cursor = NULL; + } } #endif /* SDL_VIDEO_DRIVER_WINDOWS */ diff --git a/src/video/windows/SDL_windowsopengl.c b/src/video/windows/SDL_windowsopengl.c index 97cbaffc4..9cda41596 100644 --- a/src/video/windows/SDL_windowsopengl.c +++ b/src/video/windows/SDL_windowsopengl.c @@ -22,6 +22,7 @@ #if SDL_VIDEO_DRIVER_WINDOWS +#include "SDL_assert.h" #include "SDL_windowsvideo.h" /* WGL implementation of SDL OpenGL support */ @@ -407,7 +408,7 @@ WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) &matching); } - _this->gl_data->wglMakeCurrent(NULL, NULL); + _this->gl_data->wglMakeCurrent(hdc, NULL); _this->gl_data->wglDeleteContext(hglrc); } ReleaseDC(hwnd, hdc); @@ -417,14 +418,16 @@ WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) return pixel_format; } -int -WIN_GL_SetupWindow(_THIS, SDL_Window * window) +/* actual work of WIN_GL_SetupWindow() happens here. */ +static int +WIN_GL_SetupWindowInternal(_THIS, SDL_Window * window) { HDC hdc = ((SDL_WindowData *) window->driverdata)->hdc; PIXELFORMATDESCRIPTOR pfd; int pixel_format = 0; int iAttribs[64]; int *iAttr; + int *iAccelAttr; float fAttribs[1] = { 0 }; WIN_GL_SetupPixelFormat(_this, &pfd); @@ -492,18 +495,28 @@ WIN_GL_SetupWindow(_THIS, SDL_Window * window) *iAttr++ = _this->gl_config.multisamplesamples; } + /* We always choose either FULL or NO accel on Windows, because of flaky + drivers. If the app didn't specify, we use FULL, because that's + probably what they wanted (and if you didn't care and got FULL, that's + a perfectly valid result in any case). */ *iAttr++ = WGL_ACCELERATION_ARB; - *iAttr++ = WGL_FULL_ACCELERATION_ARB; + iAccelAttr = iAttr; + if (_this->gl_config.accelerated) { + *iAttr++ = WGL_FULL_ACCELERATION_ARB; + } else { + *iAttr++ = WGL_NO_ACCELERATION_ARB; + } *iAttr = 0; /* Choose and set the closest available pixel format */ - if (_this->gl_config.accelerated != 0) { + pixel_format = WIN_GL_ChoosePixelFormatARB(_this, iAttribs, fAttribs); + + /* App said "don't care about accel" and FULL accel failed. Try NO. */ + if ( ( !pixel_format ) && ( _this->gl_config.accelerated < 0 ) ) { + *iAccelAttr = WGL_NO_ACCELERATION_ARB; pixel_format = WIN_GL_ChoosePixelFormatARB(_this, iAttribs, fAttribs); - } - if (!pixel_format && _this->gl_config.accelerated != 1) { - iAttr[-1] = WGL_NO_ACCELERATION_ARB; - pixel_format = WIN_GL_ChoosePixelFormatARB(_this, iAttribs, fAttribs); + *iAccelAttr = WGL_FULL_ACCELERATION_ARB; /* if we try again. */ } if (!pixel_format) { pixel_format = WIN_GL_ChoosePixelFormat(hdc, &pfd); @@ -517,6 +530,17 @@ WIN_GL_SetupWindow(_THIS, SDL_Window * window) return 0; } +int +WIN_GL_SetupWindow(_THIS, SDL_Window * window) +{ + /* The current context is lost in here; save it and reset it. */ + SDL_Window *current_win = SDL_GL_GetCurrentWindow(); + SDL_GLContext current_ctx = SDL_GL_GetCurrentContext(); + const int retval = WIN_GL_SetupWindowInternal(_this, window); + WIN_GL_MakeCurrent(_this, current_win, current_ctx); + return retval; +} + SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window * window) { @@ -524,19 +548,19 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) HGLRC context, share_context; if (_this->gl_config.share_with_current_context) { - share_context = (HGLRC)(_this->current_glctx); + share_context = (HGLRC)SDL_GL_GetCurrentContext(); } else { share_context = 0; } if (_this->gl_config.major_version < 3 && - _this->gl_config.profile_mask == 0 && - _this->gl_config.flags == 0) { + _this->gl_config.profile_mask == 0 && + _this->gl_config.flags == 0) { /* Create legacy context */ context = _this->gl_data->wglCreateContext(hdc); - if( share_context != 0 ) { + if( share_context != 0 ) { _this->gl_data->wglShareLists(share_context, context); - } + } } else { PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB; HGLRC temp_context = _this->gl_data->wglCreateContext(hdc); @@ -558,27 +582,27 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) SDL_SetError("GL 3.x is not supported"); context = temp_context; } else { - /* max 8 attributes plus terminator */ + /* max 8 attributes plus terminator */ int attribs[9] = { WGL_CONTEXT_MAJOR_VERSION_ARB, _this->gl_config.major_version, WGL_CONTEXT_MINOR_VERSION_ARB, _this->gl_config.minor_version, 0 }; - int iattr = 4; + int iattr = 4; - /* SDL profile bits match WGL profile bits */ - if( _this->gl_config.profile_mask != 0 ) { - attribs[iattr++] = WGL_CONTEXT_PROFILE_MASK_ARB; - attribs[iattr++] = _this->gl_config.profile_mask; - } + /* SDL profile bits match WGL profile bits */ + if( _this->gl_config.profile_mask != 0 ) { + attribs[iattr++] = WGL_CONTEXT_PROFILE_MASK_ARB; + attribs[iattr++] = _this->gl_config.profile_mask; + } - /* SDL flags match WGL flags */ - if( _this->gl_config.flags != 0 ) { - attribs[iattr++] = WGL_CONTEXT_FLAGS_ARB; - attribs[iattr++] = _this->gl_config.flags; - } + /* SDL flags match WGL flags */ + if( _this->gl_config.flags != 0 ) { + attribs[iattr++] = WGL_CONTEXT_FLAGS_ARB; + attribs[iattr++] = _this->gl_config.flags; + } - attribs[iattr++] = 0; + attribs[iattr++] = 0; /* Create the GL 3.x context */ context = wglCreateContextAttribsARB(hdc, share_context, attribs); @@ -611,11 +635,22 @@ WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) return SDL_SetError("OpenGL not initialized"); } - if (window) { - hdc = ((SDL_WindowData *) window->driverdata)->hdc; - } else { - hdc = NULL; + /* sanity check that higher level handled this. */ + SDL_assert(window || (!window && !context)); + + /* Some Windows drivers freak out if hdc is NULL, even when context is + NULL, against spec. Since hdc is _supposed_ to be ignored if context + is NULL, we either use the current GL window, or do nothing if we + already have no current context. */ + if (!window) { + window = SDL_GL_GetCurrentWindow(); + if (!window) { + SDL_assert(SDL_GL_GetCurrentContext() == NULL); + return 0; /* already done. */ + } } + + hdc = ((SDL_WindowData *) window->driverdata)->hdc; if (!_this->gl_data->wglMakeCurrent(hdc, (HGLRC) context)) { return WIN_SetError("wglMakeCurrent()"); } diff --git a/src/video/windows/SDL_windowsshape.c b/src/video/windows/SDL_windowsshape.c index 5e3286175..fdbcdfc76 100644 --- a/src/video/windows/SDL_windowsshape.c +++ b/src/video/windows/SDL_windowsshape.c @@ -36,12 +36,12 @@ Win32_CreateShaper(SDL_Window * window) { result->userx = result->usery = 0; result->driverdata = (SDL_ShapeData*)SDL_malloc(sizeof(SDL_ShapeData)); ((SDL_ShapeData*)result->driverdata)->mask_tree = NULL; - //Put some driver-data here. + /* Put some driver-data here. */ window->shaper = result; resized_properly = Win32_ResizeWindowShape(window); if (resized_properly != 0) return NULL; - + return result; } @@ -49,15 +49,15 @@ void CombineRectRegions(SDL_ShapeTree* node,void* closure) { HRGN mask_region = *((HRGN*)closure),temp_region = NULL; if(node->kind == OpaqueShape) { - //Win32 API regions exclude their outline, so we widen the region by one pixel in each direction to include the real outline. + /* Win32 API regions exclude their outline, so we widen the region by one pixel in each direction to include the real outline. */ temp_region = CreateRectRgn(node->data.shape.x,node->data.shape.y,node->data.shape.x + node->data.shape.w + 1,node->data.shape.y + node->data.shape.h + 1); if(mask_region != NULL) { CombineRgn(mask_region,mask_region,temp_region,RGN_OR); DeleteObject(temp_region); - } - else + } + else *((HRGN*)closure) = temp_region; - } + } } int @@ -77,12 +77,12 @@ Win32_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShape if(data->mask_tree != NULL) SDL_FreeShapeTree(&data->mask_tree); data->mask_tree = SDL_CalculateShapeTree(*shape_mode,shape); - + SDL_TraverseShapeTree(data->mask_tree,&CombineRectRegions,&mask_region); - SDL_assert(mask_region != NULL); + SDL_assert(mask_region != NULL); SetWindowRgn(((SDL_WindowData *)(shaper->window->driverdata))->hwnd, mask_region, TRUE); - + return 0; } @@ -95,15 +95,15 @@ Win32_ResizeWindowShape(SDL_Window *window) { data = (SDL_ShapeData *)window->shaper->driverdata; if (data == NULL) return -1; - + if(data->mask_tree != NULL) SDL_FreeShapeTree(&data->mask_tree); if(window->shaper->hasshape == SDL_TRUE) { window->shaper->userx = window->x; window->shaper->usery = window->y; SDL_SetWindowPosition(window,-1000,-1000); - } - + } + return 0; } diff --git a/src/video/windows/SDL_windowsshape.h b/src/video/windows/SDL_windowsshape.h index 3b73425e5..06aaea11e 100644 --- a/src/video/windows/SDL_windowsshape.h +++ b/src/video/windows/SDL_windowsshape.h @@ -30,7 +30,7 @@ #include "../SDL_shape_internals.h" typedef struct { - SDL_ShapeTree *mask_tree; + SDL_ShapeTree *mask_tree; } SDL_ShapeData; extern SDL_WindowShaper* Win32_CreateShaper(SDL_Window * window); diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index c64749f4f..883cafae4 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -51,9 +51,9 @@ WIN_DeleteDevice(SDL_VideoDevice * device) SDL_VideoData *data = (SDL_VideoData *) device->driverdata; SDL_UnregisterApp(); - if (data->userDLL) { - SDL_UnloadObject(data->userDLL); - } + if (data->userDLL) { + SDL_UnloadObject(data->userDLL); + } SDL_free(device->driverdata); SDL_free(device); @@ -83,12 +83,12 @@ WIN_CreateDevice(int devindex) } device->driverdata = data; - data->userDLL = SDL_LoadObject("USER32.DLL"); - if (data->userDLL) { - data->CloseTouchInputHandle = (BOOL (WINAPI *)( HTOUCHINPUT )) SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle"); - data->GetTouchInputInfo = (BOOL (WINAPI *)( HTOUCHINPUT, UINT, PTOUCHINPUT, int )) SDL_LoadFunction(data->userDLL, "GetTouchInputInfo"); - data->RegisterTouchWindow = (BOOL (WINAPI *)( HWND, ULONG )) SDL_LoadFunction(data->userDLL, "RegisterTouchWindow"); - } + data->userDLL = SDL_LoadObject("USER32.DLL"); + if (data->userDLL) { + data->CloseTouchInputHandle = (BOOL (WINAPI *)( HTOUCHINPUT )) SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle"); + data->GetTouchInputInfo = (BOOL (WINAPI *)( HTOUCHINPUT, UINT, PTOUCHINPUT, int )) SDL_LoadFunction(data->userDLL, "GetTouchInputInfo"); + data->RegisterTouchWindow = (BOOL (WINAPI *)( HWND, ULONG )) SDL_LoadFunction(data->userDLL, "RegisterTouchWindow"); + } /* Set the function pointers */ device->VideoInit = WIN_VideoInit; @@ -121,11 +121,12 @@ WIN_CreateDevice(int devindex) device->CreateWindowFramebuffer = WIN_CreateWindowFramebuffer; device->UpdateWindowFramebuffer = WIN_UpdateWindowFramebuffer; device->DestroyWindowFramebuffer = WIN_DestroyWindowFramebuffer; - + device->OnWindowEnter = WIN_OnWindowEnter; + device->shape_driver.CreateShaper = Win32_CreateShaper; device->shape_driver.SetWindowShape = Win32_SetWindowShape; device->shape_driver.ResizeWindowShape = Win32_ResizeWindowShape; - + #if SDL_VIDEO_OPENGL_WGL device->GL_LoadLibrary = WIN_GL_LoadLibrary; device->GL_GetProcAddress = WIN_GL_GetProcAddress; diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index 199a8ba8f..0943708b5 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -51,8 +51,8 @@ #if WINVER < 0x0601 /* Touch input definitions */ -#define TWF_FINETOUCH 1 -#define TWF_WANTPALM 2 +#define TWF_FINETOUCH 1 +#define TWF_WANTPALM 2 #define TOUCHEVENTF_MOVE 0x0001 #define TOUCHEVENTF_DOWN 0x0002 @@ -61,16 +61,16 @@ DECLARE_HANDLE(HTOUCHINPUT); typedef struct _TOUCHINPUT { - LONG x; - LONG y; - HANDLE hSource; - DWORD dwID; - DWORD dwFlags; - DWORD dwMask; - DWORD dwTime; - ULONG_PTR dwExtraInfo; - DWORD cxContact; - DWORD cyContact; + LONG x; + LONG y; + HANDLE hSource; + DWORD dwID; + DWORD dwFlags; + DWORD dwMask; + DWORD dwTime; + ULONG_PTR dwExtraInfo; + DWORD cxContact; + DWORD cyContact; } TOUCHINPUT, *PTOUCHINPUT; #endif /* WINVER < 0x0601 */ @@ -78,7 +78,7 @@ typedef struct _TOUCHINPUT { typedef BOOL (*PFNSHFullScreen)(HWND, DWORD); typedef void (*PFCoordTransform)(SDL_Window*, POINT*); -typedef struct +typedef struct { void **lpVtbl; int refcount; @@ -115,13 +115,13 @@ typedef struct SDL_VideoData { int render; - DWORD clipboard_count; + DWORD clipboard_count; - /* Touch input functions */ - void* userDLL; - BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT ); - BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int ); - BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG ); + /* Touch input functions */ + void* userDLL; + BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT ); + BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int ); + BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG ); SDL_bool ime_com_initialized; struct ITfThreadMgr *ime_threadmgr; diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 800349235..e83115f00 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -22,6 +22,7 @@ #if SDL_VIDEO_DRIVER_WINDOWS +#include "SDL_assert.h" #include "../SDL_sysvideo.h" #include "../SDL_pixels_c.h" #include "../../events/SDL_keyboard_c.h" @@ -73,6 +74,38 @@ GetWindowStyle(SDL_Window * window) return style; } +static void +WIN_SetWindowPositionInternal(_THIS, SDL_Window * window, UINT flags) +{ + HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + RECT rect; + DWORD style; + HWND top; + BOOL menu; + int x, y; + int w, h; + + /* Figure out what the window area will be */ + if (SDL_ShouldAllowTopmost() && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) { + top = HWND_TOPMOST; + } else { + top = HWND_NOTOPMOST; + } + style = GetWindowLong(hwnd, GWL_STYLE); + rect.left = 0; + rect.top = 0; + rect.right = window->w; + rect.bottom = window->h; + menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL); + AdjustWindowRectEx(&rect, style, menu, 0); + w = (rect.right - rect.left); + h = (rect.bottom - rect.top); + x = window->x + rect.left; + y = window->y + rect.top; + + SetWindowPos(hwnd, top, x, y, w, h, flags); +} + static int SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) { @@ -118,6 +151,20 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) #endif /* Fill in the SDL window with the window data */ + { + RECT rect; + if (GetClientRect(hwnd, &rect)) { + int w = rect.right; + int h = rect.bottom; + if ((window->w && window->w != w) || (window->h && window->h != h)) { + // We tried to create a window larger than the desktop and Windows didn't allow it. Override! + WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE); + } else { + window->w = w; + window->h = h; + } + } + } { POINT point; point.x = 0; @@ -127,13 +174,6 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) window->y = point.y; } } - { - RECT rect; - if (GetClientRect(hwnd, &rect)) { - window->w = rect.right; - window->h = rect.bottom; - } - } { DWORD style = GetWindowLong(hwnd, GWL_STYLE); if (style & WS_VISIBLE) { @@ -201,7 +241,7 @@ WIN_CreateWindow(_THIS, SDL_Window * window) DWORD style = STYLE_BASIC; int x, y; int w, h; - + style |= GetWindowStyle(window); /* Figure out what the window area will be */ @@ -290,9 +330,8 @@ WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; HICON hicon = NULL; BYTE *icon_bmp; - int icon_len; + int icon_len, y; SDL_RWops *dst; - SDL_Surface *surface; /* Create temporary bitmap buffer */ icon_len = 40 + icon->h * icon->w * 4; @@ -316,19 +355,16 @@ WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) SDL_WriteLE32(dst, 0); SDL_WriteLE32(dst, 0); - /* Convert the icon to a 32-bit surface with alpha channel */ - surface = SDL_ConvertSurfaceFormat(icon, SDL_PIXELFORMAT_ARGB8888, 0); - if (surface) { - /* Write the pixels upside down into the bitmap buffer */ - int y = surface->h; - while (y--) { - Uint8 *src = (Uint8 *) surface->pixels + y * surface->pitch; - SDL_RWwrite(dst, src, surface->pitch, 1); - } - SDL_FreeSurface(surface); - - hicon = CreateIconFromResource(icon_bmp, icon_len, TRUE, 0x00030000); + /* Write the pixels upside down into the bitmap buffer */ + SDL_assert(icon->format->format == SDL_PIXELFORMAT_ARGB8888); + y = icon->h; + while (y--) { + Uint8 *src = (Uint8 *) icon->pixels + y * icon->pitch; + SDL_RWwrite(dst, src, icon->pitch, 1); } + + hicon = CreateIconFromResource(icon_bmp, icon_len, TRUE, 0x00030000); + SDL_RWclose(dst); SDL_stack_free(icon_bmp); @@ -339,38 +375,6 @@ WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) hicon); } -static void -WIN_SetWindowPositionInternal(_THIS, SDL_Window * window, UINT flags) -{ - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - RECT rect; - DWORD style; - HWND top; - BOOL menu; - int x, y; - int w, h; - - /* Figure out what the window area will be */ - if ( SDL_ShouldAllowTopmost() && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS )) { - top = HWND_TOPMOST; - } else { - top = HWND_NOTOPMOST; - } - style = GetWindowLong(hwnd, GWL_STYLE); - rect.left = 0; - rect.top = 0; - rect.right = window->w; - rect.bottom = window->h; - menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL); - AdjustWindowRectEx(&rect, style, menu, 0); - w = (rect.right - rect.left); - h = (rect.bottom - rect.top); - x = window->x + rect.left; - y = window->y + rect.top; - - SetWindowPos(hwnd, top, x, y, w, h, flags); -} - void WIN_SetWindowPosition(_THIS, SDL_Window * window) { @@ -400,15 +404,7 @@ WIN_HideWindow(_THIS, SDL_Window * window) void WIN_RaiseWindow(_THIS, SDL_Window * window) { - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - HWND top; - - if ( SDL_ShouldAllowTopmost() && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS )) { - top = HWND_TOPMOST; - } else { - top = HWND_NOTOPMOST; - } - SetWindowPos(hwnd, top, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE)); + WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE); } void @@ -440,7 +436,7 @@ WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) } SetWindowLong(hwnd, GWL_STYLE, style); - SetWindowPos(hwnd, hwnd, window->x, window->y, window->w, window->h, SWP_FRAMECHANGED | SWP_NOREPOSITION | SWP_NOZORDER |SWP_NOACTIVATE | SWP_NOSENDCHANGING); + WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_NOREPOSITION | SWP_NOZORDER |SWP_NOACTIVATE | SWP_NOSENDCHANGING); } void @@ -464,11 +460,11 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, int x, y; int w, h; - if ( SDL_ShouldAllowTopmost() && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS )) { - top = HWND_TOPMOST; - } else { - top = HWND_NOTOPMOST; - } + if (SDL_ShouldAllowTopmost() && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) { + top = HWND_TOPMOST; + } else { + top = HWND_NOTOPMOST; + } style = GetWindowLong(hwnd, GWL_STYLE); style &= ~STYLE_MASK; @@ -550,22 +546,14 @@ WIN_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) ClipCursor(NULL); } - if ( window->flags & SDL_WINDOW_FULLSCREEN ) - { - HWND top; - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - HWND hwnd = data->hwnd; - UINT flags = SWP_NOMOVE | SWP_NOSIZE; + if (window->flags & SDL_WINDOW_FULLSCREEN) { + UINT flags = SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE; - if ( SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS ) ) { - top = HWND_TOPMOST; - } else { - top = HWND_NOTOPMOST; - flags |= SWP_NOZORDER; - } - - SetWindowPos(hwnd, top, 0, 0, 0, 0, flags); - } + if (!(window->flags & SDL_WINDOW_SHOWN)) { + flags |= SWP_NOACTIVATE; + } + WIN_SetWindowPositionInternal(_this, window, flags); + } } void @@ -678,6 +666,25 @@ SDL_HelperWindowDestroy(void) } } +void WIN_OnWindowEnter(_THIS, SDL_Window * window) +{ +#ifdef WM_MOUSELEAVE + SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + TRACKMOUSEEVENT trackMouseEvent; + + if (!data || !data->hwnd) { + /* The window wasn't fully initialized */ + return; + } + + trackMouseEvent.cbSize = sizeof(TRACKMOUSEEVENT); + trackMouseEvent.dwFlags = TME_LEAVE; + trackMouseEvent.hwndTrack = data->hwnd; + + TrackMouseEvent(&trackMouseEvent); +#endif /* WM_MOUSELEAVE */ +} + #endif /* SDL_VIDEO_DRIVER_WINDOWS */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/windows/SDL_windowswindow.h b/src/video/windows/SDL_windowswindow.h index 7339d7812..e85c20181 100644 --- a/src/video/windows/SDL_windowswindow.h +++ b/src/video/windows/SDL_windowswindow.h @@ -56,6 +56,7 @@ extern void WIN_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed); extern void WIN_DestroyWindow(_THIS, SDL_Window * window); extern SDL_bool WIN_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info); +extern void WIN_OnWindowEnter(_THIS, SDL_Window * window); #endif /* _SDL_windowswindow_h */ diff --git a/src/video/windows/wmmsg.h b/src/video/windows/wmmsg.h index 0c36cf82c..2cc7a843f 100644 --- a/src/video/windows/wmmsg.h +++ b/src/video/windows/wmmsg.h @@ -1,5 +1,5 @@ -#define MAX_WMMSG (sizeof(wmtab)/sizeof(wmtab[0])) +#define MAX_WMMSG (sizeof(wmtab)/sizeof(wmtab[0])) char *wmtab[] = { "WM_NULL", diff --git a/src/video/x11/SDL_x11clipboard.c b/src/video/x11/SDL_x11clipboard.c index 0c3b000e0..54b5eb602 100644 --- a/src/video/x11/SDL_x11clipboard.c +++ b/src/video/x11/SDL_x11clipboard.c @@ -26,6 +26,7 @@ #include "SDL_events.h" #include "SDL_x11video.h" +#include "SDL_timer.h" /* If you don't support UTF-8, you might use XA_STRING here */ @@ -94,10 +95,12 @@ X11_GetClipboardText(_THIS) unsigned long overflow; unsigned char *src; char *text; + Uint32 waitStart; + Uint32 waitElapsed; Atom XA_CLIPBOARD = XInternAtom(display, "CLIPBOARD", 0); if (XA_CLIPBOARD == None) { SDL_SetError("Couldn't access X clipboard"); - return NULL; + return SDL_strdup(""); } text = NULL; @@ -116,10 +119,23 @@ X11_GetClipboardText(_THIS) XConvertSelection(display, XA_CLIPBOARD, format, selection, owner, CurrentTime); - /* FIXME: Should we have a timeout here? */ + /* When using synergy on Linux and when data has been put in the clipboard + on the remote (Windows anyway) machine then selection_waiting may never + be set to False. Time out after a while. */ + waitStart = SDL_GetTicks(); videodata->selection_waiting = SDL_TRUE; while (videodata->selection_waiting) { SDL_PumpEvents(); + waitElapsed = SDL_GetTicks() - waitStart; + /* Wait one second for a clipboard response. */ + if (waitElapsed > 1000) { + videodata->selection_waiting = SDL_FALSE; + SDL_SetError("Clipboard timeout"); + /* We need to set the clipboard text so that next time we won't + timeout, otherwise we will hang on every call to this function. */ + X11_SetClipboardText(_this, ""); + return SDL_strdup(""); + } } } @@ -139,7 +155,7 @@ X11_GetClipboardText(_THIS) if (!text) { text = SDL_strdup(""); } - + return text; } @@ -151,7 +167,7 @@ X11_HasClipboardText(_THIS) if (text) { result = (SDL_strlen(text)>0) ? SDL_TRUE : SDL_FALSE; SDL_free(text); - } + } return result; } diff --git a/src/video/x11/SDL_x11dyn.c b/src/video/x11/SDL_x11dyn.c index dbd7d7c13..ab0eafb4d 100644 --- a/src/video/x11/SDL_x11dyn.c +++ b/src/video/x11/SDL_x11dyn.c @@ -107,9 +107,9 @@ X11_GetSym(const char *fnname, int *pHasModule) /* Define all the function pointers and wrappers... */ #define SDL_X11_MODULE(modname) #define SDL_X11_SYM(rc,fn,params,args,ret) \ - typedef rc (*SDL_DYNX11FN_##fn) params; \ - static SDL_DYNX11FN_##fn p##fn = NULL; \ - rc fn params { ret p##fn args ; } + typedef rc (*SDL_DYNX11FN_##fn) params; \ + static SDL_DYNX11FN_##fn p##fn = NULL; \ + rc fn params { ret p##fn args ; } #include "SDL_x11sym.h" #undef SDL_X11_MODULE #undef SDL_X11_SYM diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 6c54e9dc9..a9a3ac996 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -42,29 +42,29 @@ #include typedef struct { - unsigned char *data; - int format, count; - Atom type; + unsigned char *data; + int format, count; + Atom type; } SDL_x11Prop; /* Reads property Must call XFree on results */ -static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) +static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) { unsigned char *ret=NULL; Atom type; int fmt; unsigned long count; unsigned long bytes_left; - int bytes_fetch = 0; - + int bytes_fetch = 0; + do { if (ret != 0) XFree(ret); XGetWindowProperty(disp, w, prop, 0, bytes_fetch, False, AnyPropertyType, &type, &fmt, &count, &bytes_left, &ret); bytes_fetch += bytes_left; } while (bytes_left != 0); - + p->data=ret; p->format=fmt; p->count=count; @@ -99,37 +99,60 @@ static Atom X11_PickTargetFromAtoms(Display *disp, Atom a0, Atom a1, Atom a2) } /*#define DEBUG_XEVENTS*/ +struct KeyRepeatCheckData +{ + XEvent *event; + SDL_bool found; +}; + +static Bool X11_KeyRepeatCheckIfEvent(Display *display, XEvent *chkev, + XPointer arg) +{ + struct KeyRepeatCheckData *d = (struct KeyRepeatCheckData *) arg; + if (chkev->type == KeyPress && + chkev->xkey.keycode == d->event->xkey.keycode && + chkev->xkey.time - d->event->xkey.time < 2) + d->found = SDL_TRUE; + return False; +} + /* Check to see if this is a repeated key. (idea shamelessly lifted from GII -- thanks guys! :) */ static SDL_bool X11_KeyRepeat(Display *display, XEvent *event) { - XEvent peekevent; + XEvent dummyev; + struct KeyRepeatCheckData d; + d.event = event; + d.found = SDL_FALSE; + if (XPending(display)) + XCheckIfEvent(display, &dummyev, X11_KeyRepeatCheckIfEvent, + (XPointer) &d); + return d.found; +} - if (XPending(display)) { - XPeekEvent(display, &peekevent); - if ((peekevent.type == KeyPress) && - (peekevent.xkey.keycode == event->xkey.keycode) && - ((peekevent.xkey.time-event->xkey.time) < 2)) { - return SDL_TRUE; - } - } - return SDL_FALSE; +static Bool X11_IsWheelCheckIfEvent(Display *display, XEvent *chkev, + XPointer arg) +{ + XEvent *event = (XEvent *) arg; + if (chkev->type == ButtonRelease && + chkev->xbutton.button == event->xbutton.button && + chkev->xbutton.time == event->xbutton.time) + return True; + return False; } static SDL_bool X11_IsWheelEvent(Display * display,XEvent * event,int * ticks) { - XEvent peekevent; + XEvent relevent; if (XPending(display)) { /* according to the xlib docs, no specific mouse wheel events exist. however, mouse wheel events trigger a button press and a button release immediately. thus, checking if the same button was released at the same - time as it was pressed, should be an adequate hack to derive a mouse + time as it was pressed, should be an adequate hack to derive a mouse wheel event. */ - XPeekEvent(display,&peekevent); - if ((peekevent.type == ButtonRelease) && - (peekevent.xbutton.button == event->xbutton.button) && - (peekevent.xbutton.time == event->xbutton.time)) { + if (XCheckIfEvent(display, &relevent, X11_IsWheelCheckIfEvent, + (XPointer) event)) { /* by default, X11 only knows 5 buttons. on most 3 button + wheel mouse, Button4 maps to wheel up, Button5 maps to wheel down. */ @@ -139,9 +162,6 @@ static SDL_bool X11_IsWheelEvent(Display * display,XEvent * event,int * ticks) else if (event->xbutton.button == Button5) { *ticks = -1; } - - /* remove the following release event, as this is now a wheel event */ - XNextEvent(display,&peekevent); return SDL_TRUE; } } @@ -187,10 +207,12 @@ static char* X11_URIToLocal(char* uri) { #if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS static void X11_HandleGenericEvent(SDL_VideoData *videodata,XEvent event) { + /* event is a union, so cookie == &event, but this is type safe. */ XGenericEventCookie *cookie = &event.xcookie; - XGetEventData(videodata->display, cookie); - X11_HandleXinput2Event(videodata,cookie); - XFreeEventData(videodata->display,cookie); + if (XGetEventData(videodata->display, cookie)) { + X11_HandleXinput2Event(videodata, cookie); + XFreeEventData(videodata->display, cookie); + } } #endif /* SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */ @@ -310,6 +332,10 @@ X11_DispatchEvent(_THIS) printf("Mode: NotifyUngrab\n"); #endif SDL_SetMouseFocus(data->window); + + if (!SDL_GetMouse()->relative_mode) { + SDL_SendMouseMotion(data->window, 0, 0, xevent.xcrossing.x, xevent.xcrossing.y); + } } break; /* Losing mouse coverage? */ @@ -324,6 +350,10 @@ X11_DispatchEvent(_THIS) if (xevent.xcrossing.mode == NotifyUngrab) printf("Mode: NotifyUngrab\n"); #endif + if (!SDL_GetMouse()->relative_mode) { + SDL_SendMouseMotion(data->window, 0, 0, xevent.xcrossing.x, xevent.xcrossing.y); + } + if (xevent.xcrossing.mode != NotifyGrab && xevent.xcrossing.mode != NotifyUngrab && xevent.xcrossing.detail != NotifyInferior) { @@ -348,7 +378,13 @@ X11_DispatchEvent(_THIS) /* We want to reset the keyboard here, because we may have missed keyboard messages after our previous FocusOut. */ - SDL_ResetKeyboard(); + /* Actually, if we do this we clear the ALT key on Unity + because it briefly takes focus for their dashboard. + + I think it's better to think the ALT key is held down + when it's not, then always lose the ALT modifier on Unity. + */ + /*SDL_ResetKeyboard();*/ } data->pending_focus = PENDING_FOCUS_IN; data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_IN_TIME; @@ -493,7 +529,7 @@ X11_DispatchEvent(_THIS) case ClientMessage:{ int xdnd_version=0; - + if (xevent.xclient.message_type == videodata->XdndEnter) { SDL_bool use_list = xevent.xclient.data.l[1] & 1; data->xdnd_source = xevent.xclient.data.l[0]; @@ -511,7 +547,7 @@ X11_DispatchEvent(_THIS) } } else if (xevent.xclient.message_type == videodata->XdndPosition) { - + /* reply with status */ XClientMessageEvent m; memset(&m, 0, sizeof(XClientMessageEvent)); @@ -525,7 +561,7 @@ X11_DispatchEvent(_THIS) m.data.l[2] = 0; /* specify an empty rectangle */ m.data.l[3] = 0; m.data.l[4] = videodata->XdndActionCopy; /* we only accept copying anyway */ - + XSendEvent(display, xevent.xclient.data.l[0], False, NoEventMask, (XEvent*)&m); XFlush(display); } @@ -546,9 +582,9 @@ X11_DispatchEvent(_THIS) } else { /* convert */ if(xdnd_version >= 1) { - XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, xevent.xclient.data.l[2]); + XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, xevent.xclient.data.l[2]); } else { - XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, CurrentTime); + XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, CurrentTime); } } } @@ -588,7 +624,7 @@ X11_DispatchEvent(_THIS) break; case MotionNotify:{ - SDL_Mouse *mouse = SDL_GetMouse(); + SDL_Mouse *mouse = SDL_GetMouse(); if(!mouse->relative_mode) { #ifdef DEBUG_MOTION printf("window %p: X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y); @@ -763,12 +799,11 @@ X11_DispatchEvent(_THIS) #endif Atom target = xevent.xselection.target; if (target == data->xdnd_req) { - /* read data */ SDL_x11Prop p; X11_ReadProperty(&p, display, data->xwindow, videodata->PRIMARY); - - if(p.format==8) { + + if (p.format == 8) { SDL_bool expect_lf = SDL_FALSE; char *start = NULL; char *scan = (char*)p.data; @@ -777,21 +812,24 @@ X11_DispatchEvent(_THIS) int length = 0; while (p.count--) { if (!expect_lf) { - if (*scan==0x0D) { + if (*scan == 0x0D) { expect_lf = SDL_TRUE; - } else if(start == NULL) { + } + if (start == NULL) { start = scan; length = 0; } length++; } else { - if (*scan==0x0A && length>0) { - uri = malloc(length--); - memcpy(uri, start, length); - uri[length] = 0; + if (*scan == 0x0A && length > 0) { + uri = SDL_malloc(length--); + SDL_memcpy(uri, start, length); + uri[length] = '\0'; fn = X11_URIToLocal(uri); - if (fn) SDL_SendDropFile(fn); - free(uri); + if (fn) { + SDL_SendDropFile(fn); + } + SDL_free(uri); } expect_lf = SDL_FALSE; start = NULL; @@ -799,28 +837,27 @@ X11_DispatchEvent(_THIS) scan++; } } - + XFree(p.data); - + /* send reply */ XClientMessageEvent m; - memset(&m, 0, sizeof(XClientMessageEvent)); + SDL_memset(&m, 0, sizeof(XClientMessageEvent)); m.type = ClientMessage; m.display = display; m.window = data->xdnd_source; m.message_type = videodata->XdndFinished; - m.format=32; + m.format = 32; m.data.l[0] = data->xwindow; m.data.l[1] = 1; m.data.l[2] = videodata->XdndActionCopy; XSendEvent(display, data->xdnd_source, False, NoEventMask, (XEvent*)&m); - + XSync(display, False); - + } else { videodata->selection_waiting = SDL_FALSE; } - } break; @@ -907,7 +944,7 @@ X11_PumpEvents(_THIS) data->screensaver_activity = now; } - } + } /* Keep processing pending events */ while (X11_Pending(data->display)) { diff --git a/src/video/x11/SDL_x11framebuffer.c b/src/video/x11/SDL_x11framebuffer.c index 0c8febe4a..4dfe0d174 100644 --- a/src/video/x11/SDL_x11framebuffer.c +++ b/src/video/x11/SDL_x11framebuffer.c @@ -111,7 +111,7 @@ X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, if (!shm_error) { data->ximage = XShmCreateImage(display, data->visual, vinfo.depth, ZPixmap, - shminfo->shmaddr, shminfo, + shminfo->shmaddr, shminfo, window->w, window->h); if (!data->ximage) { XShmDetach(display, shminfo); @@ -133,7 +133,7 @@ X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, } data->ximage = XCreateImage(display, data->visual, - vinfo.depth, ZPixmap, 0, (char *)(*pixels), + vinfo.depth, ZPixmap, 0, (char *)(*pixels), window->w, window->h, 32, 0); if (!data->ximage) { SDL_free(*pixels); diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index eae2f3d0f..81d64b2df 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -35,102 +35,102 @@ /* *INDENT-OFF* */ static const struct { KeySym keysym; - SDL_Keycode sdlkey; -} KeySymToSDLKey[] = { - { XK_Return, SDLK_RETURN }, - { XK_Escape, SDLK_ESCAPE }, - { XK_BackSpace, SDLK_BACKSPACE }, - { XK_Tab, SDLK_TAB }, - { XK_Caps_Lock, SDLK_CAPSLOCK }, - { XK_F1, SDLK_F1 }, - { XK_F2, SDLK_F2 }, - { XK_F3, SDLK_F3 }, - { XK_F4, SDLK_F4 }, - { XK_F5, SDLK_F5 }, - { XK_F6, SDLK_F6 }, - { XK_F7, SDLK_F7 }, - { XK_F8, SDLK_F8 }, - { XK_F9, SDLK_F9 }, - { XK_F10, SDLK_F10 }, - { XK_F11, SDLK_F11 }, - { XK_F12, SDLK_F12 }, - { XK_Print, SDLK_PRINTSCREEN }, - { XK_Scroll_Lock, SDLK_SCROLLLOCK }, - { XK_Pause, SDLK_PAUSE }, - { XK_Insert, SDLK_INSERT }, - { XK_Home, SDLK_HOME }, - { XK_Prior, SDLK_PAGEUP }, - { XK_Delete, SDLK_DELETE }, - { XK_End, SDLK_END }, - { XK_Next, SDLK_PAGEDOWN }, - { XK_Right, SDLK_RIGHT }, - { XK_Left, SDLK_LEFT }, - { XK_Down, SDLK_DOWN }, - { XK_Up, SDLK_UP }, - { XK_Num_Lock, SDLK_NUMLOCKCLEAR }, - { XK_KP_Divide, SDLK_KP_DIVIDE }, - { XK_KP_Multiply, SDLK_KP_MULTIPLY }, - { XK_KP_Subtract, SDLK_KP_MINUS }, - { XK_KP_Add, SDLK_KP_PLUS }, - { XK_KP_Enter, SDLK_KP_ENTER }, - { XK_KP_Delete, SDLK_KP_PERIOD }, - { XK_KP_End, SDLK_KP_1 }, - { XK_KP_Down, SDLK_KP_2 }, - { XK_KP_Next, SDLK_KP_3 }, - { XK_KP_Left, SDLK_KP_4 }, - { XK_KP_Begin, SDLK_KP_5 }, - { XK_KP_Right, SDLK_KP_6 }, - { XK_KP_Home, SDLK_KP_7 }, - { XK_KP_Up, SDLK_KP_8 }, - { XK_KP_Prior, SDLK_KP_9 }, - { XK_KP_Insert, SDLK_KP_0 }, - { XK_KP_Decimal, SDLK_KP_PERIOD }, - { XK_KP_1, SDLK_KP_1 }, - { XK_KP_2, SDLK_KP_2 }, - { XK_KP_3, SDLK_KP_3 }, - { XK_KP_4, SDLK_KP_4 }, - { XK_KP_5, SDLK_KP_5 }, - { XK_KP_6, SDLK_KP_6 }, - { XK_KP_7, SDLK_KP_7 }, - { XK_KP_8, SDLK_KP_8 }, - { XK_KP_9, SDLK_KP_9 }, - { XK_KP_0, SDLK_KP_0 }, - { XK_KP_Decimal, SDLK_KP_PERIOD }, - { XK_Hyper_R, SDLK_APPLICATION }, - { XK_KP_Equal, SDLK_KP_EQUALS }, - { XK_F13, SDLK_F13 }, - { XK_F14, SDLK_F14 }, - { XK_F15, SDLK_F15 }, - { XK_F16, SDLK_F16 }, - { XK_F17, SDLK_F17 }, - { XK_F18, SDLK_F18 }, - { XK_F19, SDLK_F19 }, - { XK_F20, SDLK_F20 }, - { XK_F21, SDLK_F21 }, - { XK_F22, SDLK_F22 }, - { XK_F23, SDLK_F23 }, - { XK_F24, SDLK_F24 }, - { XK_Execute, SDLK_EXECUTE }, - { XK_Help, SDLK_HELP }, - { XK_Menu, SDLK_MENU }, - { XK_Select, SDLK_SELECT }, - { XK_Cancel, SDLK_STOP }, - { XK_Redo, SDLK_AGAIN }, - { XK_Undo, SDLK_UNDO }, - { XK_Find, SDLK_FIND }, - { XK_KP_Separator, SDLK_KP_COMMA }, - { XK_Sys_Req, SDLK_SYSREQ }, - { XK_Control_L, SDLK_LCTRL }, - { XK_Shift_L, SDLK_LSHIFT }, - { XK_Alt_L, SDLK_LALT }, - { XK_Meta_L, SDLK_LGUI }, - { XK_Super_L, SDLK_LGUI }, - { XK_Control_R, SDLK_RCTRL }, - { XK_Shift_R, SDLK_RSHIFT }, - { XK_Alt_R, SDLK_RALT }, - { XK_Meta_R, SDLK_RGUI }, - { XK_Super_R, SDLK_RGUI }, - { XK_Mode_switch, SDLK_MODE }, + SDL_Scancode scancode; +} KeySymToSDLScancode[] = { + { XK_Return, SDL_SCANCODE_RETURN }, + { XK_Escape, SDL_SCANCODE_ESCAPE }, + { XK_BackSpace, SDL_SCANCODE_BACKSPACE }, + { XK_Tab, SDL_SCANCODE_TAB }, + { XK_Caps_Lock, SDL_SCANCODE_CAPSLOCK }, + { XK_F1, SDL_SCANCODE_F1 }, + { XK_F2, SDL_SCANCODE_F2 }, + { XK_F3, SDL_SCANCODE_F3 }, + { XK_F4, SDL_SCANCODE_F4 }, + { XK_F5, SDL_SCANCODE_F5 }, + { XK_F6, SDL_SCANCODE_F6 }, + { XK_F7, SDL_SCANCODE_F7 }, + { XK_F8, SDL_SCANCODE_F8 }, + { XK_F9, SDL_SCANCODE_F9 }, + { XK_F10, SDL_SCANCODE_F10 }, + { XK_F11, SDL_SCANCODE_F11 }, + { XK_F12, SDL_SCANCODE_F12 }, + { XK_Print, SDL_SCANCODE_PRINTSCREEN }, + { XK_Scroll_Lock, SDL_SCANCODE_SCROLLLOCK }, + { XK_Pause, SDL_SCANCODE_PAUSE }, + { XK_Insert, SDL_SCANCODE_INSERT }, + { XK_Home, SDL_SCANCODE_HOME }, + { XK_Prior, SDL_SCANCODE_PAGEUP }, + { XK_Delete, SDL_SCANCODE_DELETE }, + { XK_End, SDL_SCANCODE_END }, + { XK_Next, SDL_SCANCODE_PAGEDOWN }, + { XK_Right, SDL_SCANCODE_RIGHT }, + { XK_Left, SDL_SCANCODE_LEFT }, + { XK_Down, SDL_SCANCODE_DOWN }, + { XK_Up, SDL_SCANCODE_UP }, + { XK_Num_Lock, SDL_SCANCODE_NUMLOCKCLEAR }, + { XK_KP_Divide, SDL_SCANCODE_KP_DIVIDE }, + { XK_KP_Multiply, SDL_SCANCODE_KP_MULTIPLY }, + { XK_KP_Subtract, SDL_SCANCODE_KP_MINUS }, + { XK_KP_Add, SDL_SCANCODE_KP_PLUS }, + { XK_KP_Enter, SDL_SCANCODE_KP_ENTER }, + { XK_KP_Delete, SDL_SCANCODE_KP_PERIOD }, + { XK_KP_End, SDL_SCANCODE_KP_1 }, + { XK_KP_Down, SDL_SCANCODE_KP_2 }, + { XK_KP_Next, SDL_SCANCODE_KP_3 }, + { XK_KP_Left, SDL_SCANCODE_KP_4 }, + { XK_KP_Begin, SDL_SCANCODE_KP_5 }, + { XK_KP_Right, SDL_SCANCODE_KP_6 }, + { XK_KP_Home, SDL_SCANCODE_KP_7 }, + { XK_KP_Up, SDL_SCANCODE_KP_8 }, + { XK_KP_Prior, SDL_SCANCODE_KP_9 }, + { XK_KP_Insert, SDL_SCANCODE_KP_0 }, + { XK_KP_Decimal, SDL_SCANCODE_KP_PERIOD }, + { XK_KP_1, SDL_SCANCODE_KP_1 }, + { XK_KP_2, SDL_SCANCODE_KP_2 }, + { XK_KP_3, SDL_SCANCODE_KP_3 }, + { XK_KP_4, SDL_SCANCODE_KP_4 }, + { XK_KP_5, SDL_SCANCODE_KP_5 }, + { XK_KP_6, SDL_SCANCODE_KP_6 }, + { XK_KP_7, SDL_SCANCODE_KP_7 }, + { XK_KP_8, SDL_SCANCODE_KP_8 }, + { XK_KP_9, SDL_SCANCODE_KP_9 }, + { XK_KP_0, SDL_SCANCODE_KP_0 }, + { XK_KP_Decimal, SDL_SCANCODE_KP_PERIOD }, + { XK_Hyper_R, SDL_SCANCODE_APPLICATION }, + { XK_KP_Equal, SDL_SCANCODE_KP_EQUALS }, + { XK_F13, SDL_SCANCODE_F13 }, + { XK_F14, SDL_SCANCODE_F14 }, + { XK_F15, SDL_SCANCODE_F15 }, + { XK_F16, SDL_SCANCODE_F16 }, + { XK_F17, SDL_SCANCODE_F17 }, + { XK_F18, SDL_SCANCODE_F18 }, + { XK_F19, SDL_SCANCODE_F19 }, + { XK_F20, SDL_SCANCODE_F20 }, + { XK_F21, SDL_SCANCODE_F21 }, + { XK_F22, SDL_SCANCODE_F22 }, + { XK_F23, SDL_SCANCODE_F23 }, + { XK_F24, SDL_SCANCODE_F24 }, + { XK_Execute, SDL_SCANCODE_EXECUTE }, + { XK_Help, SDL_SCANCODE_HELP }, + { XK_Menu, SDL_SCANCODE_MENU }, + { XK_Select, SDL_SCANCODE_SELECT }, + { XK_Cancel, SDL_SCANCODE_STOP }, + { XK_Redo, SDL_SCANCODE_AGAIN }, + { XK_Undo, SDL_SCANCODE_UNDO }, + { XK_Find, SDL_SCANCODE_FIND }, + { XK_KP_Separator, SDL_SCANCODE_KP_COMMA }, + { XK_Sys_Req, SDL_SCANCODE_SYSREQ }, + { XK_Control_L, SDL_SCANCODE_LCTRL }, + { XK_Shift_L, SDL_SCANCODE_LSHIFT }, + { XK_Alt_L, SDL_SCANCODE_LALT }, + { XK_Meta_L, SDL_SCANCODE_LGUI }, + { XK_Super_L, SDL_SCANCODE_LGUI }, + { XK_Control_R, SDL_SCANCODE_RCTRL }, + { XK_Shift_R, SDL_SCANCODE_RSHIFT }, + { XK_Alt_R, SDL_SCANCODE_RALT }, + { XK_Meta_R, SDL_SCANCODE_RGUI }, + { XK_Super_R, SDL_SCANCODE_RGUI }, + { XK_Mode_switch, SDL_SCANCODE_MODE }, }; static const struct @@ -144,11 +144,11 @@ static const struct }; /* *INDENT-OFF* */ -static SDL_Keycode -X11_KeyCodeToSDLKey(Display *display, KeyCode keycode) +/* This function only works for keyboards in US QWERTY layout */ +static SDL_Scancode +X11_KeyCodeToSDLScancode(Display *display, KeyCode keycode) { KeySym keysym; - unsigned int ucs4; int i; #if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @@ -157,20 +157,40 @@ X11_KeyCodeToSDLKey(Display *display, KeyCode keycode) keysym = XKeycodeToKeysym(display, keycode, 0); #endif if (keysym == NoSymbol) { - return SDLK_UNKNOWN; + return SDL_SCANCODE_UNKNOWN; } - ucs4 = X11_KeySymToUcs4(keysym); - if (ucs4) { - return (SDL_Keycode) ucs4; + if (keysym >= XK_A && keysym <= XK_Z) { + return SDL_SCANCODE_A + (keysym - XK_A); } - for (i = 0; i < SDL_arraysize(KeySymToSDLKey); ++i) { - if (keysym == KeySymToSDLKey[i].keysym) { - return KeySymToSDLKey[i].sdlkey; + if (keysym >= XK_0 && keysym <= XK_9) { + return SDL_SCANCODE_0 + (keysym - XK_0); + } + + for (i = 0; i < SDL_arraysize(KeySymToSDLScancode); ++i) { + if (keysym == KeySymToSDLScancode[i].keysym) { + return KeySymToSDLScancode[i].scancode; } } - return SDLK_UNKNOWN; + return SDL_SCANCODE_UNKNOWN; +} + +static Uint32 +X11_KeyCodeToUcs4(Display *display, KeyCode keycode) +{ + KeySym keysym; + +#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM + keysym = XkbKeycodeToKeysym(display, keycode, 0, 0); +#else + keysym = XKeycodeToKeysym(display, keycode, 0); +#endif + if (keysym == NoSymbol) { + return 0; + } + + return X11_KeySymToUcs4(keysym); } int @@ -242,17 +262,12 @@ X11_InitKeyboard(_THIS) sym = XKeycodeToKeysym(data->display, i, 0); #endif if (sym != NoSymbol) { - SDL_Keycode key; + SDL_Scancode scancode; printf("code = %d, sym = 0x%X (%s) ", i - min_keycode, (unsigned int) sym, XKeysymToString(sym)); - key = X11_KeyCodeToSDLKey(data->display, i); - for (j = 0; j < SDL_arraysize(keymap); ++j) { - if (keymap[j] == key) { - data->key_layout[i] = (SDL_Scancode) j; - break; - } - } - if (j == SDL_arraysize(keymap)) { + scancode = X11_KeyCodeToSDLScancode(data->display, i); + data->key_layout[i] = scancode; + if (scancode == SDL_SCANCODE_UNKNOWN) { printf("scancode not found\n"); } else { printf("scancode = %d (%s)\n", j, SDL_GetScancodeName(j)); @@ -276,9 +291,9 @@ X11_UpdateKeymap(_THIS) SDL_Scancode scancode; SDL_Keycode keymap[SDL_NUM_SCANCODES]; - SDL_zero(keymap); - + SDL_GetDefaultKeymap(keymap); for (i = 0; i < SDL_arraysize(data->key_layout); i++) { + Uint32 key; /* Make sure this is a valid scancode */ scancode = data->key_layout[i]; @@ -286,7 +301,11 @@ X11_UpdateKeymap(_THIS) continue; } - keymap[scancode] = X11_KeyCodeToSDLKey(data->display, (KeyCode)i); + /* See if there is a UCS keycode for this scancode */ + key = X11_KeyCodeToUcs4(data->display, (KeyCode)i); + if (key) { + keymap[scancode] = key; + } } SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); } diff --git a/src/video/x11/SDL_x11messagebox.c b/src/video/x11/SDL_x11messagebox.c index 47cac1c66..f938ded8b 100644 --- a/src/video/x11/SDL_x11messagebox.c +++ b/src/video/x11/SDL_x11messagebox.c @@ -78,11 +78,11 @@ typedef struct TextLineData { const char *text; /* Text for this line */ } TextLineData; -typedef struct SDL_MessageBoxDataX11 { - XFontSet font_set; /* for UTF-8 systems */ - XFontStruct *font_struct; /* Latin1 (ASCII) fallback. */ - Window window; +typedef struct SDL_MessageBoxDataX11 +{ Display *display; + int screen; + Window window; long event_mask; Atom wm_protocols; Atom wm_delete_message; @@ -90,6 +90,8 @@ typedef struct SDL_MessageBoxDataX11 { int dialog_width; /* Dialog box width. */ int dialog_height; /* Dialog box height. */ + XFontSet font_set; /* for UTF-8 systems */ + XFontStruct *font_struct; /* Latin1 (ASCII) fallback. */ int xtext, ytext; /* Text position to start drawing at. */ int numlines; /* Count of Text lines. */ int text_height; /* Height for text lines. */ @@ -347,7 +349,7 @@ X11_MessageBoxShutdown( SDL_MessageBoxDataX11 *data ) if ( data->display ) { if ( data->window != None ) { - XUnmapWindow( data->display, data->window ); + XWithdrawWindow( data->display, data->window, data->screen ); XDestroyWindow( data->display, data->window ); data->window = None; } @@ -369,7 +371,12 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) const SDL_MessageBoxData *messageboxdata = data->messageboxdata; if ( messageboxdata->window ) { + SDL_DisplayData *displaydata = + (SDL_DisplayData *) SDL_GetDisplayForWindow(messageboxdata->window)->driverdata; windowdata = (SDL_WindowData *)messageboxdata->window->driverdata; + data->screen = displaydata->screen; + } else { + data->screen = DefaultScreen( display ); } data->event_mask = ExposureMask | @@ -378,7 +385,7 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) wnd_attr.event_mask = data->event_mask; data->window = XCreateWindow( - display, DefaultRootWindow( display ), + display, RootWindow(display, data->screen), 0, 0, data->dialog_width, data->dialog_height, 0, CopyFromParent, InputOutput, CopyFromParent, @@ -406,11 +413,10 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) XGetWindowAttributes(display, windowdata->xwindow, &attrib); x = attrib.x + ( attrib.width - data->dialog_width ) / 2; y = attrib.y + ( attrib.height - data->dialog_height ) / 3 ; - XTranslateCoordinates(display, windowdata->xwindow, DefaultRootWindow( display ), x, y, &x, &y, &dummy); + XTranslateCoordinates(display, windowdata->xwindow, RootWindow(display, data->screen), x, y, &x, &y, &dummy); } else { - int screen = DefaultScreen( display ); - x = ( DisplayWidth( display, screen ) - data->dialog_width ) / 2; - y = ( DisplayHeight( display, screen ) - data->dialog_height ) / 3 ; + x = ( DisplayWidth( display, data->screen ) - data->dialog_width ) / 2; + y = ( DisplayHeight( display, data->screen ) - data->dialog_height ) / 3 ; } XMoveWindow( display, data->window, x, y ); @@ -700,8 +706,8 @@ X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) int fds[2]; int status = 0; - /* Need to flush here in case someone has turned grab off and it hasn't gone through yet, etc. */ - XFlush(data->display); + /* Need to flush here in case someone has turned grab off and it hasn't gone through yet, etc. */ + XFlush(data->display); if (pipe(fds) == -1) { return X11_ShowMessageBoxImpl(messageboxdata, buttonid); /* oh well. */ diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 60363b491..b66b94b1a 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -577,7 +577,7 @@ X11_InitModes(_THIS) unsigned long nitems, bytes_after; Atom actual_type; - if (props[i] == EDID) { + if (props[i] == EDID) { if (XRRGetOutputProperty(data->display, res->outputs[output], props[i], 0, 100, False, False, @@ -689,9 +689,11 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) #if SDL_VIDEO_DRIVER_X11_XINERAMA if (data->use_xinerama) { - /* Add the full (both screens combined) xinerama mode only on the display that starts at 0,0 */ - if (!data->xinerama_info.x_org && !data->xinerama_info.y_org && + if (data->use_vidmode && !data->xinerama_info.x_org && !data->xinerama_info.y_org && (screen_w > data->xinerama_info.width || screen_h > data->xinerama_info.height)) { + /* Add the full (both screens combined) xinerama mode only on the display that starts at 0,0 + * if we're using vidmode. + */ mode.w = screen_w; mode.h = screen_h; mode.refresh_rate = 0; @@ -702,6 +704,20 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) mode.driverdata = modedata; SDL_AddDisplayMode(sdl_display, &mode); } + else if (!data->use_xrandr) + { + /* Add the current mode of each monitor otherwise if we can't get them from xrandr */ + mode.w = data->xinerama_info.width; + mode.h = data->xinerama_info.height; + mode.refresh_rate = 0; + modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData)); + if (modedata) { + *modedata = *(SDL_DisplayModeData *)sdl_display->desktop_mode.driverdata; + } + mode.driverdata = modedata; + SDL_AddDisplayMode(sdl_display, &mode); + } + } #endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */ @@ -844,7 +860,6 @@ X11_QuitModes(_THIS) int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect) { - Display *display = ((SDL_VideoData *) _this->driverdata)->display; SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata; rect->x = data->x; @@ -855,6 +870,7 @@ X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect) #if SDL_VIDEO_DRIVER_X11_XINERAMA /* Get the real current bounds of the display */ if (data->use_xinerama) { + Display *display = ((SDL_VideoData *) _this->driverdata)->display; int screencount; XineramaScreenInfo *xinerama = XineramaQueryScreens(display, &screencount); if (xinerama) { diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 1d021b7b6..441ecdfe3 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -194,8 +194,8 @@ X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y) surface->w, surface->h); cursor = XCreatePixmapCursor(display, data_pixmap, mask_pixmap, &fg, &bg, hot_x, hot_y); - XFreePixmap(display, data_pixmap); - XFreePixmap(display, mask_pixmap); + XFreePixmap(display, data_pixmap); + XFreePixmap(display, mask_pixmap); return cursor; } @@ -236,8 +236,8 @@ X11_CreateSystemCursor(SDL_SystemCursor id) default: SDL_assert(0); return NULL; - // X Font Cursors reference: - // http://tronche.com/gui/x/xlib/appendix/b/ + /* X Font Cursors reference: */ + /* http://tronche.com/gui/x/xlib/appendix/b/ */ case SDL_SYSTEM_CURSOR_ARROW: shape = XC_left_ptr; break; case SDL_SYSTEM_CURSOR_IBEAM: shape = XC_xterm; break; case SDL_SYSTEM_CURSOR_WAIT: shape = XC_watch; break; @@ -336,7 +336,7 @@ X11_InitMouse(_THIS) SDL_Mouse *mouse = SDL_GetMouse(); mouse->CreateCursor = X11_CreateCursor; - mouse->CreateSystemCursor = X11_CreateSystemCursor; + mouse->CreateSystemCursor = X11_CreateSystemCursor; mouse->ShowCursor = X11_ShowCursor; mouse->FreeCursor = X11_FreeCursor; mouse->WarpMouse = X11_WarpMouse; diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index 8e6614bef..2eaed8698 100644 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -33,13 +33,13 @@ #if defined(__IRIX__) /* IRIX doesn't have a GL library versioning system */ -#define DEFAULT_OPENGL "libGL.so" +#define DEFAULT_OPENGL "libGL.so" #elif defined(__MACOSX__) -#define DEFAULT_OPENGL "/usr/X11R6/lib/libGL.1.dylib" +#define DEFAULT_OPENGL "/usr/X11R6/lib/libGL.1.dylib" #elif defined(__QNXNTO__) -#define DEFAULT_OPENGL "libGL.so.3" +#define DEFAULT_OPENGL "libGL.so.3" #else -#define DEFAULT_OPENGL "libGL.so.1" +#define DEFAULT_OPENGL "libGL.so.1" #endif #ifndef GLX_NONE_EXT @@ -118,13 +118,13 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy, #define OPENGL_REQUIRES_DLOPEN #if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN) #include -#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL)) -#define GL_LoadFunction dlsym -#define GL_UnloadObject dlclose +#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL)) +#define GL_LoadFunction dlsym +#define GL_UnloadObject dlclose #else -#define GL_LoadObject SDL_LoadObject -#define GL_LoadFunction SDL_LoadFunction -#define GL_UnloadObject SDL_UnloadObject +#define GL_LoadObject SDL_LoadObject +#define GL_LoadFunction SDL_LoadFunction +#define GL_UnloadObject SDL_UnloadObject #endif static void X11_GL_InitExtensions(_THIS); @@ -133,6 +133,7 @@ static void X11_GL_InitExtensions(_THIS); int X11_GL_LoadLibrary(_THIS, const char *path) { + Display *display; void *handle; if (_this->gl_data) { @@ -186,6 +187,9 @@ X11_GL_LoadLibrary(_THIS, const char *path) /* Load function pointers */ handle = _this->gl_config.dll_handle; + _this->gl_data->glXQueryExtension = + (Bool (*)(Display *, int *, int *)) + GL_LoadFunction(handle, "glXQueryExtension"); _this->gl_data->glXGetProcAddress = (void *(*)(const GLubyte *)) GL_LoadFunction(handle, "glXGetProcAddressARB"); @@ -208,7 +212,8 @@ X11_GL_LoadLibrary(_THIS, const char *path) (void (*)(Display*,GLXDrawable,int,unsigned int*)) X11_GL_GetProcAddress(_this, "glXQueryDrawable"); - if (!_this->gl_data->glXChooseVisual || + if (!_this->gl_data->glXQueryExtension || + !_this->gl_data->glXChooseVisual || !_this->gl_data->glXCreateContext || !_this->gl_data->glXDestroyContext || !_this->gl_data->glXMakeCurrent || @@ -216,6 +221,11 @@ X11_GL_LoadLibrary(_THIS, const char *path) return SDL_SetError("Could not retrieve OpenGL functions"); } + display = ((SDL_VideoData *) _this->driverdata)->display; + if (!_this->gl_data->glXQueryExtension(display, &_this->gl_data->errorBase, &_this->gl_data->eventBase)) { + return SDL_SetError("GLX is not supported"); + } + /* Initialize extensions */ X11_GL_InitExtensions(_this); @@ -369,21 +379,21 @@ X11_GL_InitExtensions(_THIS) } /* glXChooseVisual and glXChooseFBConfig have some small differences in - * the attribute encoding, it can be chosen with the for_FBConfig parameter. + * the attribute encoding, it can be chosen with the for_FBConfig parameter. */ -int +int X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int size, Bool for_FBConfig) { int i = 0; - const int MAX_ATTRIBUTES = 64; + const int MAX_ATTRIBUTES = 64; - /* assert buffer is large enough to hold all SDL attributes. */ + /* assert buffer is large enough to hold all SDL attributes. */ SDL_assert(size >= MAX_ATTRIBUTES); /* Setup our GLX attributes according to the gl_config. */ if( for_FBConfig ) { attribs[i++] = GLX_RENDER_TYPE; - attribs[i++] = GLX_RGBA_BIT; + attribs[i++] = GLX_RGBA_BIT; } else { attribs[i++] = GLX_RGBA; } @@ -401,8 +411,9 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si if (_this->gl_config.double_buffer) { attribs[i++] = GLX_DOUBLEBUFFER; - if( for_FBConfig ) - attribs[i++] = True; + if( for_FBConfig ) { + attribs[i++] = True; + } } attribs[i++] = GLX_DEPTH_SIZE; @@ -435,8 +446,9 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si if (_this->gl_config.stereo) { attribs[i++] = GLX_STEREO; - if( for_FBConfig ) - attribs[i++] = True; + if( for_FBConfig ) { + attribs[i++] = True; + } } if (_this->gl_config.multisamplebuffers) { @@ -467,7 +479,7 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si attribs[i++] = None; SDL_assert(i <= MAX_ATTRIBUTES); - + return i; } @@ -502,19 +514,23 @@ X11_GL_GetVisual(_THIS, Display * display, int screen) #define GLXBadProfileARB 13 #endif static int (*handler) (Display *, XErrorEvent *) = NULL; +static int errorBase = 0; static int X11_GL_CreateContextErrorHandler(Display * d, XErrorEvent * e) { switch (e->error_code) { - case GLXBadContext: - case GLXBadFBConfig: - case GLXBadProfileARB: case BadRequest: case BadMatch: case BadValue: case BadAlloc: return (0); default: + if (errorBase && + (e->error_code == errorBase + GLXBadContext || + e->error_code == errorBase + GLXBadFBConfig || + e->error_code == errorBase + GLXBadProfileARB)) { + return (0); + } return (handler(d, e)); } } @@ -532,13 +548,14 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) GLXContext context = NULL, share_context; if (_this->gl_config.share_with_current_context) { - share_context = (GLXContext)(_this->current_glctx); + share_context = (GLXContext)SDL_GL_GetCurrentContext(); } else { share_context = NULL; } /* We do this to create a clean separation between X and GLX errors. */ XSync(display, False); + errorBase = _this->gl_data->errorBase; handler = XSetErrorHandler(X11_GL_CreateContextErrorHandler); XGetWindowAttributes(display, data->xwindow, &xattr); v.screen = screen; @@ -631,7 +648,7 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) } XSync(display, False); XSetErrorHandler(handler); - + if (!context) { SDL_SetError("Could not create GL context"); return NULL; @@ -664,7 +681,7 @@ X11_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) return 0; } -/* +/* 0 is a valid argument to glxSwapInterval(MESA|EXT) and setting it to 0 will undo the effect of a previous call with a value that is greater than zero (or at least that is what the docs say). OTOH, 0 is an invalid @@ -683,7 +700,7 @@ X11_GL_SetSwapInterval(_THIS, int interval) } else if (_this->gl_data->glXSwapIntervalEXT) { Display *display = ((SDL_VideoData *) _this->driverdata)->display; const SDL_WindowData *windowdata = (SDL_WindowData *) - _this->current_glwin->driverdata; + SDL_GL_GetCurrentWindow()->driverdata; Window drawable = windowdata->xwindow; @@ -727,7 +744,7 @@ X11_GL_GetSwapInterval(_THIS) if (_this->gl_data->glXSwapIntervalEXT) { Display *display = ((SDL_VideoData *) _this->driverdata)->display; const SDL_WindowData *windowdata = (SDL_WindowData *) - _this->current_glwin->driverdata; + SDL_GL_GetCurrentWindow()->driverdata; Window drawable = windowdata->xwindow; unsigned int allow_late_swap_tearing = 0; unsigned int interval = 0; diff --git a/src/video/x11/SDL_x11opengl.h b/src/video/x11/SDL_x11opengl.h index 69ad1c2b9..db1b3152e 100644 --- a/src/video/x11/SDL_x11opengl.h +++ b/src/video/x11/SDL_x11opengl.h @@ -29,10 +29,13 @@ struct SDL_GLDriverData { + int errorBase, eventBase; + SDL_bool HAS_GLX_EXT_visual_rating; SDL_bool HAS_GLX_EXT_visual_info; SDL_bool HAS_GLX_EXT_swap_control_tear; + Bool (*glXQueryExtension) (Display*,int*,int*); void *(*glXGetProcAddress) (const GLubyte*); XVisualInfo *(*glXChooseVisual) (Display*,int,int*); GLXContext (*glXCreateContext) (Display*,XVisualInfo*,GLXContext,Bool); diff --git a/src/video/x11/SDL_x11opengles.c b/src/video/x11/SDL_x11opengles.c index 279c58c34..ba72aff17 100644 --- a/src/video/x11/SDL_x11opengles.c +++ b/src/video/x11/SDL_x11opengles.c @@ -32,11 +32,11 @@ #define DEFAULT_OGL_ES "libGLESv1_CM.so" #define LOAD_FUNC(NAME) \ - *((void**)&_this->gles_data->NAME) = dlsym(handle, #NAME); \ - if (!_this->gles_data->NAME) \ - { \ - return SDL_SetError("Could not retrieve EGL function " #NAME); \ - } + *((void**)&_this->gles_data->NAME) = dlsym(handle, #NAME); \ + if (!_this->gles_data->NAME) \ + { \ + return SDL_SetError("Could not retrieve EGL function " #NAME); \ + } /* GLES implementation of SDL OpenGL support */ @@ -54,7 +54,7 @@ X11_GLES_GetProcAddress(_THIS, const char *proc) return retval; } } - + handle = _this->gl_config.dll_handle; #if defined(__OpenBSD__) && !defined(__ELF__) #undef dlsym(x,y); @@ -212,7 +212,7 @@ X11_GLES_GetVisual(_THIS, Display * display, int screen) /* 64 seems nice. */ EGLint attribs[64]; EGLint found_configs = 0; - VisualID visual_id; + EGLint visual_id; int i; if (!_this->gles_data) { @@ -277,7 +277,7 @@ X11_GLES_GetVisual(_THIS, Display * display, int screen) if (_this->gles_data->eglGetConfigAttrib(_this->gles_data->egl_display, _this->gles_data->egl_config, EGL_NATIVE_VISUAL_ID, - (EGLint *) & visual_id) == + &visual_id) == EGL_FALSE || !visual_id) { /* Use the default visual when all else fails */ XVisualInfo vi_in; @@ -379,7 +379,7 @@ X11_GLES_SetSwapInterval(_THIS, int interval) status = _this->gles_data->eglSwapInterval(_this->gles_data->egl_display, interval); if (status == EGL_TRUE) { _this->gles_data->egl_swapinterval = interval; - return 0; + return 0; } return SDL_SetError("Unable to set the EGL swap interval"); @@ -406,7 +406,7 @@ void X11_GLES_DeleteContext(_THIS, SDL_GLContext context) { /* Clean up GLES and EGL */ - if (!_this->gles_data) { + if (!_this->gles_data) { return; } diff --git a/src/video/x11/SDL_x11shape.c b/src/video/x11/SDL_x11shape.c index e1e68934e..cea280722 100644 --- a/src/video/x11/SDL_x11shape.c +++ b/src/video/x11/SDL_x11shape.c @@ -61,7 +61,7 @@ int X11_ResizeWindowShape(SDL_Window* window) { SDL_ShapeData* data = window->shaper->driverdata; SDL_assert(data != NULL); - + unsigned int bitmapsize = window->w / 8; if(window->w % 8 > 0) bitmapsize += 1; @@ -76,14 +76,14 @@ X11_ResizeWindowShape(SDL_Window* window) { } } memset(data->bitmap,0,data->bitmapsize); - + window->shaper->userx = window->x; window->shaper->usery = window->y; SDL_SetWindowPosition(window,-1000,-1000); - + return 0; } - + int X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) { if(shaper == NULL || shape == NULL || shaper->driverdata == NULL) @@ -95,13 +95,13 @@ X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMo if(shape->w != shaper->window->w || shape->h != shaper->window->h) return -3; SDL_ShapeData *data = shaper->driverdata; - + /* Assume that shaper->alphacutoff already has a value, because SDL_SetWindowShape() should have given it one. */ SDL_CalculateShapeBitmap(shaper->mode,shape,data->bitmap,8); - + SDL_WindowData *windowdata = (SDL_WindowData*)(shaper->window->driverdata); Pixmap shapemask = XCreateBitmapFromData(windowdata->videodata->display,windowdata->xwindow,data->bitmap,shaper->window->w,shaper->window->h); - + XShapeCombineMask(windowdata->videodata->display,windowdata->xwindow, ShapeBounding, 0, 0,shapemask, ShapeSet); XSync(windowdata->videodata->display,False); diff --git a/src/video/x11/SDL_x11shape.h b/src/video/x11/SDL_x11shape.h index d7c389283..96b4a8b0a 100644 --- a/src/video/x11/SDL_x11shape.h +++ b/src/video/x11/SDL_x11shape.h @@ -28,13 +28,13 @@ #include "../SDL_sysvideo.h" typedef struct { - void* bitmap; - Uint32 bitmapsize; + void* bitmap; + Uint32 bitmapsize; } SDL_ShapeData; extern SDL_Window* X11_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); extern SDL_WindowShaper* X11_CreateShaper(SDL_Window* window); extern int X11_ResizeWindowShape(SDL_Window* window); -extern int X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode); +extern int X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode); #endif /* _SDL_x11shape_h */ diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index b6e99aa47..79f61e0fb 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -125,9 +125,9 @@ SDL_X11_SYM(int,XUngrabPointer,(Display* a,Time b),(a,b),return) SDL_X11_SYM(int,XUngrabServer,(Display* a),(a),return) SDL_X11_SYM(int,XUninstallColormap,(Display* a,Colormap b),(a,b),return) SDL_X11_SYM(int,XUnloadFont,(Display* a,Font b),(a,b),return) -SDL_X11_SYM(int,XUnmapWindow,(Display* a,Window b),(a,b),return) SDL_X11_SYM(int,XWarpPointer,(Display* a,Window b,Window c,int d,int e,unsigned int f,unsigned int g,int h,int i),(a,b,c,d,e,f,g,h,i),return) SDL_X11_SYM(int,XWindowEvent,(Display* a,Window b,long c,XEvent* d),(a,b,c,d),return) +SDL_X11_SYM(Status,XWithdrawWindow,(Display* a,Window b,int c),(a,b,c),return) SDL_X11_SYM(VisualID,XVisualIDFromVisual,(Visual* a),(a),return) #if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY SDL_X11_SYM(XExtDisplayInfo*,XextAddDisplay,(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f),(a,b,c,d,e,f),return) @@ -203,7 +203,11 @@ SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return) */ #ifdef LONG64 SDL_X11_MODULE(IO_32BIT) +#if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 +SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return) +#else SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return) +#endif SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),) #endif diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 4794241e9..86597ecf2 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -32,7 +32,7 @@ #include "SDL_x11video.h" #include "SDL_x11framebuffer.h" #include "SDL_x11shape.h" -#include "SDL_x11touch.h" +#include "SDL_x11touch.h" #include "SDL_x11xinput2.h" #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 @@ -362,6 +362,8 @@ X11_CreateDevice(int devindex) device->SetWindowIcon = X11_SetWindowIcon; device->SetWindowPosition = X11_SetWindowPosition; device->SetWindowSize = X11_SetWindowSize; + device->SetWindowMinimumSize = X11_SetWindowMinimumSize; + device->SetWindowMaximumSize = X11_SetWindowMaximumSize; device->ShowWindow = X11_ShowWindow; device->HideWindow = X11_HideWindow; device->RaiseWindow = X11_RaiseWindow; diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 9411b7b7e..68a041326 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -110,9 +110,9 @@ typedef struct SDL_VideoData Atom XdndDrop; Atom XdndFinished; Atom XdndSelection; - + SDL_Scancode key_layout[256]; - SDL_bool selection_waiting; + SDL_bool selection_waiting; #if SDL_USE_LIBDBUS DBusConnection *dbus; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 6403ac4b4..02529e08a 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -22,6 +22,7 @@ #if SDL_VIDEO_DRIVER_X11 +#include "SDL_assert.h" #include "SDL_hints.h" #include "../SDL_sysvideo.h" #include "../SDL_pixels_c.h" @@ -58,6 +59,21 @@ static Bool isConfigureNotify(Display *dpy, XEvent *ev, XPointer win) return ev->type == ConfigureNotify && ev->xconfigure.window == *((Window*)win); } +/* +static Bool +XIfEventTimeout(Display *display, XEvent *event_return, Bool (*predicate)(), XPointer arg, int timeoutMS) +{ + Uint32 start = SDL_GetTicks(); + + while (!XCheckIfEvent(display, event_return, predicate, arg)) { + if ((SDL_GetTicks() - start) >= timeoutMS) { + return False; + } + } + return True; +} +*/ + static SDL_bool X11_IsWindowLegacyFullscreen(_THIS, SDL_Window * window) { @@ -339,6 +355,8 @@ X11_CreateWindow(_THIS, SDL_Window * window) XSizeHints *sizehints; XWMHints *wmhints; XClassHint *classhints; + const long _NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1; + Atom _NET_WM_BYPASS_COMPOSITOR; Atom _NET_WM_WINDOW_TYPE; Atom _NET_WM_WINDOW_TYPE_NORMAL; Atom _NET_WM_PID; @@ -349,7 +367,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) if (window->flags & SDL_WINDOW_OPENGL) { XVisualInfo *vinfo; -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 if (_this->gl_config.use_egl == 1) { vinfo = X11_GLES_GetVisual(_this, display, screen); } else @@ -532,7 +550,11 @@ X11_CreateWindow(_THIS, SDL_Window * window) PropModeReplace, (unsigned char *)&_NET_WM_WINDOW_TYPE_NORMAL, 1); - + _NET_WM_BYPASS_COMPOSITOR = XInternAtom(display, "_NET_WM_BYPASS_COMPOSITOR", False); + XChangeProperty(display, w, _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32, + PropModeReplace, + (unsigned char *)&_NET_WM_BYPASS_COMPOSITOR_HINT_ON, 1); + { Atom protocols[] = { data->WM_DELETE_WINDOW, /* Allow window to be deleted by the WM */ @@ -565,7 +587,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) XdndAware = XInternAtom(display, "XdndAware", False); XChangeProperty(display, w, XdndAware, XA_ATOM, 32, PropModeReplace, - (unsigned char*)&xdnd_version, 1); + (unsigned char*)&xdnd_version, 1); XFlush(display); @@ -692,19 +714,11 @@ X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) Atom _NET_WM_ICON = data->videodata->_NET_WM_ICON; if (icon) { - SDL_PixelFormat format; - SDL_Surface *surface; int propsize; long *propdata; - /* Convert the icon to ARGB for modern window managers */ - SDL_InitFormat(&format, SDL_PIXELFORMAT_ARGB8888); - surface = SDL_ConvertSurface(icon, &format, 0); - if (!surface) { - return; - } - /* Set the _NET_WM_ICON property */ + SDL_assert(icon->format->format == SDL_PIXELFORMAT_ARGB8888); propsize = 2 + (icon->w * icon->h); propdata = SDL_malloc(propsize * sizeof(long)); if (propdata) { @@ -716,7 +730,7 @@ X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) propdata[1] = icon->h; dst = &propdata[2]; for (y = 0; y < icon->h; ++y) { - src = (Uint32*)((Uint8*)surface->pixels + y * surface->pitch); + src = (Uint32*)((Uint8*)icon->pixels + y * icon->pitch); for (x = 0; x < icon->w; ++x) { *dst++ = *src++; } @@ -726,7 +740,6 @@ X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) propsize); } SDL_free(propdata); - SDL_FreeSurface(surface); } else { XDeleteProperty(display, data->xwindow, _NET_WM_ICON); } @@ -743,6 +756,64 @@ X11_SetWindowPosition(_THIS, SDL_Window * window) XFlush(display); } +void +X11_SetWindowMinimumSize(_THIS, SDL_Window * window) +{ + SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + Display *display = data->videodata->display; + + if (window->flags & SDL_WINDOW_RESIZABLE) { + XSizeHints *sizehints = XAllocSizeHints(); + long userhints; + + XGetWMNormalHints(display, data->xwindow, sizehints, &userhints); + + sizehints->min_width = window->min_w; + sizehints->min_height = window->min_h; + sizehints->flags |= PMinSize; + + XSetWMNormalHints(display, data->xwindow, sizehints); + + XFree(sizehints); + + /* See comment in X11_SetWindowSize. */ + XResizeWindow(display, data->xwindow, window->w, window->h); + XMoveWindow(display, data->xwindow, window->x, window->y); + XRaiseWindow(display, data->xwindow); + } + + XFlush(display); +} + +void +X11_SetWindowMaximumSize(_THIS, SDL_Window * window) +{ + SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + Display *display = data->videodata->display; + + if (window->flags & SDL_WINDOW_RESIZABLE) { + XSizeHints *sizehints = XAllocSizeHints(); + long userhints; + + XGetWMNormalHints(display, data->xwindow, sizehints, &userhints); + + sizehints->max_width = window->max_w; + sizehints->max_height = window->max_h; + sizehints->flags |= PMaxSize; + + XSetWMNormalHints(display, data->xwindow, sizehints); + + XFree(sizehints); + + /* See comment in X11_SetWindowSize. */ + XResizeWindow(display, data->xwindow, window->w, window->h); + XMoveWindow(display, data->xwindow, window->x, window->y); + XRaiseWindow(display, data->xwindow); + } + + XFlush(display); +} + void X11_SetWindowSize(_THIS, SDL_Window * window) { @@ -762,6 +833,7 @@ X11_SetWindowSize(_THIS, SDL_Window * window) sizehints->min_width = sizehints->max_width = window->w; sizehints->min_height = sizehints->max_height = window->h; + sizehints->flags |= PMinSize | PMaxSize; XSetWMNormalHints(display, data->xwindow, sizehints); @@ -836,7 +908,7 @@ X11_ShowWindow(_THIS, SDL_Window * window) if (!X11_IsWindowMapped(_this, window)) { XMapRaised(display, data->xwindow); /* Blocking wait for "MapNotify" event. - * We use XIfEvent because XWindowEvent takes a mask rather than a type, + * We use XIfEvent because XWindowEvent takes a mask rather than a type, * and XCheckTypedWindowEvent doesn't block */ XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow); XFlush(display); @@ -847,13 +919,14 @@ void X11_HideWindow(_THIS, SDL_Window * window) { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; Display *display = data->videodata->display; XEvent event; if (X11_IsWindowMapped(_this, window)) { - XUnmapWindow(display, data->xwindow); + XWithdrawWindow(display, data->xwindow, displaydata->screen); /* Blocking wait for "UnmapNotify" event */ - XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow); + XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow); XFlush(display); } } @@ -879,6 +952,12 @@ SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) Atom _NET_WM_STATE_MAXIMIZED_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT; Atom _NET_WM_STATE_MAXIMIZED_HORZ = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ; + if (maximized) { + window->flags |= SDL_WINDOW_MAXIMIZED; + } else { + window->flags &= ~SDL_WINDOW_MAXIMIZED; + } + if (X11_IsWindowMapped(_this, window)) { XEvent e; @@ -896,15 +975,7 @@ SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) XSendEvent(display, RootWindow(display, displaydata->screen), 0, SubstructureNotifyMask | SubstructureRedirectMask, &e); } else { - Uint32 flags; - - flags = window->flags; - if (maximized) { - flags |= SDL_WINDOW_MAXIMIZED; - } else { - flags &= ~SDL_WINDOW_MAXIMIZED; - } - X11_SetNetWMState(_this, data->xwindow, flags); + X11_SetNetWMState(_this, data->xwindow, window->flags); } XFlush(display); } @@ -922,7 +993,7 @@ X11_MinimizeWindow(_THIS, SDL_Window * window) SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; Display *display = data->videodata->display; - + XIconifyWindow(display, data->xwindow, displaydata->screen); XFlush(display); } @@ -934,7 +1005,7 @@ SetWindowActive(_THIS, SDL_Window * window) SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; Display *display = data->videodata->display; - Atom _NET_ACTIVE_WINDOW = data->videodata->_NET_ACTIVE_WINDOW; + Atom _NET_ACTIVE_WINDOW = data->videodata->_NET_ACTIVE_WINDOW; if (X11_IsWindowMapped(_this, window)) { XEvent e; @@ -945,13 +1016,13 @@ SetWindowActive(_THIS, SDL_Window * window) e.xclient.format = 32; e.xclient.window = data->xwindow; e.xclient.data.l[0] = 1; /* source indication. 1 = application */ - e.xclient.data.l[1] = CurrentTime; - e.xclient.data.l[2] = 0; + e.xclient.data.l[1] = CurrentTime; + e.xclient.data.l[2] = 0; XSendEvent(display, RootWindow(display, displaydata->screen), 0, SubstructureNotifyMask | SubstructureRedirectMask, &e); - XFlush(display); + XFlush(display); } } @@ -959,7 +1030,7 @@ void X11_RestoreWindow(_THIS, SDL_Window * window) { SetWindowMaximized(_this, window, SDL_FALSE); - SetWindowActive(_this, window); + SetWindowActive(_this, window); X11_ShowWindow(_this, window); } @@ -1031,13 +1102,6 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis XFlush(display); } -static __inline__ int -maxint(const int a, const int b) -{ - return (a > b ? a : b); -} - - /* This handles fullscreen itself, outside the Window Manager. */ static void X11_BeginWindowFullscreenLegacy(_THIS, SDL_Window * window, SDL_VideoDisplay * _display) @@ -1101,6 +1165,9 @@ X11_BeginWindowFullscreenLegacy(_THIS, SDL_Window * window, SDL_VideoDisplay * _ XReparentWindow(display, data->xwindow, data->fswindow, (rect.w - window->w) / 2, (rect.h - window->h) / 2); + /* Move the mouse to the upper left to make sure it's on-screen */ + XWarpPointer(display, None, root, 0, 0, 0, 0, rect.x, rect.y); + /* Center mouse in the fullscreen window. */ rect.x += (rect.w / 2); rect.y += (rect.h / 2); @@ -1141,13 +1208,14 @@ X11_EndWindowFullscreenLegacy(_THIS, SDL_Window * window, SDL_VideoDisplay * _di XReparentWindow(display, data->xwindow, root, window->x, window->y); /* flush these events so they don't confuse normal event handling */ - XIfEvent(display, &ev, &isUnmapNotify, (XPointer)&data->xwindow); - XIfEvent(display, &ev, &isMapNotify, (XPointer)&data->xwindow); + XSync(display, False); + XCheckIfEvent(display, &ev, &isMapNotify, (XPointer)&data->xwindow); + XCheckIfEvent(display, &ev, &isUnmapNotify, (XPointer)&data->xwindow); SetWindowBordered(display, screen, data->xwindow, (window->flags & SDL_WINDOW_BORDERLESS) == 0); - XUnmapWindow(display, fswindow); + XWithdrawWindow(display, fswindow, screen); /* Wait to be unmapped. */ XIfEvent(display, &ev, &isUnmapNotify, (XPointer)&fswindow); diff --git a/src/video/x11/SDL_x11window.h b/src/video/x11/SDL_x11window.h index b9cb750b6..f53fd8aa2 100644 --- a/src/video/x11/SDL_x11window.h +++ b/src/video/x11/SDL_x11window.h @@ -70,6 +70,8 @@ extern char *X11_GetWindowTitle(_THIS, Window xwindow); extern void X11_SetWindowTitle(_THIS, SDL_Window * window); extern void X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon); extern void X11_SetWindowPosition(_THIS, SDL_Window * window); +extern void X11_SetWindowMinimumSize(_THIS, SDL_Window * window); +extern void X11_SetWindowMaximumSize(_THIS, SDL_Window * window); extern void X11_SetWindowSize(_THIS, SDL_Window * window); extern void X11_ShowWindow(_THIS, SDL_Window * window); extern void X11_HideWindow(_THIS, SDL_Window * window); diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index 2bd466a54..1b86c6774 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -39,7 +39,7 @@ static int xinput2_multitouch_supported = 0; /* Opcode returned XQueryExtension * It will be used in event processing * to know that the event came from - * this extension */ + * this extension */ static int xinput2_opcode; static void parse_valuators(const double *input_values,unsigned char *mask,int mask_len, @@ -61,7 +61,7 @@ static void parse_valuators(const double *input_values,unsigned char *mask,int m } #endif /* SDL_VIDEO_DRIVER_X11_XINPUT2 */ -void +void X11_InitXinput2(_THIS) { #if SDL_VIDEO_DRIVER_X11_XINPUT2 @@ -78,8 +78,8 @@ X11_InitXinput2(_THIS) /* * Initialize XInput 2 * According to http://who-t.blogspot.com/2009/05/xi2-recipes-part-1.html its better - * to inform Xserver what version of Xinput we support.The server will store the version we support. - * "As XI2 progresses it becomes important that you use this call as the server may treat the client + * to inform Xserver what version of Xinput we support.The server will store the version we support. + * "As XI2 progresses it becomes important that you use this call as the server may treat the client * differently depending on the supported version". * * FIXME:event and err are not needed but if not passed XQueryExtension returns SegmentationFault @@ -114,14 +114,14 @@ X11_InitXinput2(_THIS) eventmask.mask = mask; XISetMask(mask, XI_RawMotion); - + if (XISelectEvents(data->display,DefaultRootWindow(data->display),&eventmask,1) != Success) { - return; + return; } #endif } -int +int X11_HandleXinput2Event(SDL_VideoData *videodata,XGenericEventCookie *cookie) { #if SDL_VIDEO_DRIVER_X11_XINPUT2 @@ -172,7 +172,7 @@ X11_HandleXinput2Event(SDL_VideoData *videodata,XGenericEventCookie *cookie) return 0; } -void +void X11_InitXinput2Multitouch(_THIS) { #if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @@ -202,7 +202,7 @@ X11_InitXinput2Multitouch(_THIS) #endif } -void +void X11_Xinput2SelectTouch(_THIS, SDL_Window *window) { #if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @@ -222,13 +222,13 @@ X11_Xinput2SelectTouch(_THIS, SDL_Window *window) XISetMask(mask, XI_TouchBegin); XISetMask(mask, XI_TouchUpdate); XISetMask(mask, XI_TouchEnd); - + XISelectEvents(data->display,window_data->xwindow,&eventmask,1); #endif } -int +int X11_Xinput2IsInitialized() { #if SDL_VIDEO_DRIVER_X11_XINPUT2 diff --git a/src/video/x11/SDL_x11xinput2.h b/src/video/x11/SDL_x11xinput2.h index e74018f9c..56a4b906c 100644 --- a/src/video/x11/SDL_x11xinput2.h +++ b/src/video/x11/SDL_x11xinput2.h @@ -24,11 +24,11 @@ #define _SDL_x11xinput2_h #ifndef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS -/*Define XGenericEventCookie as forward declaration when +/*Define XGenericEventCookie as forward declaration when *xinput2 is not available in order to compile*/ struct XGenericEventCookie; typedef struct XGenericEventCookie XGenericEventCookie; -#endif +#endif extern void X11_InitXinput2(_THIS); extern void X11_InitXinput2Multitouch(_THIS); diff --git a/test/Makefile.in b/test/Makefile.in index e54b29e37..2a39afc6b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -13,6 +13,7 @@ TARGETS = \ testaudioinfo$(EXE) \ testautomation$(EXE) \ testdraw2$(EXE) \ + testdrawchessboard$(EXE) \ testerror$(EXE) \ testfile$(EXE) \ testgamecontroller$(EXE) \ @@ -69,22 +70,24 @@ testaudioinfo$(EXE): $(srcdir)/testaudioinfo.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) testautomation$(EXE): $(srcdir)/testautomation.c \ + $(srcdir)/testautomation_audio.c \ $(srcdir)/testautomation_clipboard.c \ + $(srcdir)/testautomation_events.c \ + $(srcdir)/testautomation_keyboard.c \ $(srcdir)/testautomation_main.c \ + $(srcdir)/testautomation_mouse.c \ + $(srcdir)/testautomation_pixels.c \ $(srcdir)/testautomation_platform.c \ $(srcdir)/testautomation_rect.c \ $(srcdir)/testautomation_render.c \ $(srcdir)/testautomation_rwops.c \ - $(srcdir)/testautomation_audio.c \ - $(srcdir)/testautomation_surface.c \ - $(srcdir)/testautomation_events.c \ - $(srcdir)/testautomation_keyboard.c \ - $(srcdir)/testautomation_video.c \ - $(srcdir)/testautomation_syswm.c \ $(srcdir)/testautomation_sdltest.c \ - $(srcdir)/testautomation_mouse.c \ - $(srcdir)/testautomation_timer.c - $(CC) -o $@ $^ $(CFLAGS) -lSDL2_test $(LIBS) + $(srcdir)/testautomation_stdlib.c \ + $(srcdir)/testautomation_surface.c \ + $(srcdir)/testautomation_syswm.c \ + $(srcdir)/testautomation_timer.c \ + $(srcdir)/testautomation_video.c + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @@ -101,6 +104,9 @@ testrelative$(EXE): $(srcdir)/testrelative.c testdraw2$(EXE): $(srcdir)/testdraw2.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) +testdrawchessboard$(EXE): $(srcdir)/testdrawchessboard.c + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) + testerror$(EXE): $(srcdir)/testerror.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @@ -149,9 +155,8 @@ testlock$(EXE): $(srcdir)/testlock.c ifeq (@ISMACOSX@,true) testnative$(EXE): $(srcdir)/testnative.c \ $(srcdir)/testnativecocoa.m \ - $(srcdir)/testnativew32.c \ $(srcdir)/testnativex11.c - $(CC) -o $@ $^ $(CFLAGS) $(LIBS) -L/usr/X11/lib -lX11 -framework Cocoa + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) -framework Cocoa @XLIB@ endif ifeq (@ISWINDOWS@,true) @@ -163,7 +168,7 @@ endif ifeq (@ISUNIX@,true) testnative$(EXE): $(srcdir)/testnative.c \ $(srcdir)/testnativex11.c - $(CC) -o $@ $^ $(CFLAGS) $(LIBS) -L/usr/X11/lib -lX11 + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @XLIB@ endif testoverlay2$(EXE): $(srcdir)/testoverlay2.c diff --git a/test/automated/Makefile b/test/automated/Makefile deleted file mode 100644 index ff18eea40..000000000 --- a/test/automated/Makefile +++ /dev/null @@ -1,60 +0,0 @@ - - -CFLAGS := -W -Wall -Wextra -g `sdl2-config --prefix=/usr/local --cflags` -DSDL_NO_COMPAT -LDFLAGS := `sdl2-config --prefix=/usr/local --libs` - -# If it doesn't pick up defaults -#CFLAGS := -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/local/include/SDL2 -#LDFLAGS := -lm -ldl -lesd -lpthread - -SRC := testsdl.c \ - platform/platform.c \ - rect/rect.c \ - surface/surface.c \ - render/render.c \ - audio/audio.c -COMMON_SRC := SDL_at.c common/common.c -COMMON_INCLUDE := SDL_at.h - -RWOPS_SRC := rwops/rwops.c rwops/TestSupportRWops_Generic.c - -TESTS_ALL := testsdl \ - platform/platform \ - rwops/rwops \ - rect/rect \ - surface/surface \ - render/render \ - audio/audio - - -.PHONY: all clean test - - -all: $(TESTS_ALL) - -test: all - @./testsdl - -testsdl: $(SRC) $(RWOPS_SRC) $(COMMON_SRC) - $(CC) $(CFLAGS) -o $@ $(SRC) $(RWOPS_SRC) $(COMMON_SRC) $(LDFLAGS) - -platform/platform: platform/platform.c $(COMMON_INCLUDE) $(COMMON_SRC) - $(CC) $(CFLAGS) -o $@ platform/platform.c $(COMMON_SRC) -DTEST_STANDALONE $(LDFLAGS) - -rwops/rwops: $(RWOPS_SRC) $(COMMON_INCLUDE) $(COMMON_SRC) - $(CC) $(CFLAGS) -o $@ $(RWOPS_SRC) $(COMMON_SRC) -DTEST_STANDALONE $(LDFLAGS) - -rect/rect: rect/rect.c $(COMMON_INCLUDE) $(COMMON_SRC) - $(CC) $(CFLAGS) -o $@ rect/rect.c $(COMMON_SRC) -DTEST_STANDALONE $(LDFLAGS) - -surface/surface: surface/surface.c $(COMMON_INCLUDE) $(COMMON_SRC) - $(CC) $(CFLAGS) -o $@ surface/surface.c $(COMMON_SRC) -DTEST_STANDALONE $(LDFLAGS) - -render/render: render/render.c $(COMMON_INCLUDE) $(COMMON_SRC) - $(CC) $(CFLAGS) -o $@ render/render.c $(COMMON_SRC) -DTEST_STANDALONE $(LDFLAGS) - -audio/audio: audio/audio.c $(COMMON_INCLUDE) $(COMMON_SRC) - $(CC) $(CFLAGS) -o $@ audio/audio.c $(COMMON_SRC) -DTEST_STANDALONE $(LDFLAGS) - -clean: - $(RM) $(TESTS_ALL) diff --git a/test/automated/README b/test/automated/README deleted file mode 100644 index e6984a12b..000000000 --- a/test/automated/README +++ /dev/null @@ -1,59 +0,0 @@ - - - SDL Automated Testing Framework User Documentation - by Edgar Simo Serra - - - - Abstract - - The SDL Automated Testing Framework, hereby after called SDL_AT, is a meant -to test the SDL code for regressions and other possible failures. It can also -be used to display what your SDL set up supports. - - - - Basics - - The main way to use the framework is to compile it and run it, that can be -done with the following command: - - $> make test - - It should then display something like: - - Platform : All tests successful (2) - SDL_RWops : All tests successful (5) - SDL_Surface : All tests successful (6) - Rendering with x11 driver : All tests successful (4) - - Indicating that all tests were successful. If however a test fails output it -will report the failure to stderr indicating where and why it happened. This -output can then be sent to the developers so they can attempt to fix the -problem. - - - - Advanced - - By passing the "-h" or "--help" parameter to testsdl you can get an overview -of all the possible options you can set to furthur tweak the testing. A sample -of the options would be the following: - - Usage: ./testsdl [OPTIONS] - Options are: - -m, --manual enables tests that require user interaction - --noplatform do not run the platform tests - --norwops do not run the rwops tests - --nosurface do not run the surface tests - --norender do not run the render tests - -v, --verbose increases verbosity level by 1 for each -v - -q, --quiet only displays errors - -h, --help display this message and exit - - - - Developers - - See SDL_at.h for developer information. - diff --git a/test/automated/SDL_at.c b/test/automated/SDL_at.c deleted file mode 100644 index 97cd92d51..000000000 --- a/test/automated/SDL_at.c +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Common code for automated test suite. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#include "SDL_at.h" -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include /* printf/fprintf */ -#include /* va_list */ - - -/* - * Internal usage SDL_AT variables. - */ -static char *at_suite_msg = NULL; /**< Testsuite message. */ -static char *at_test_msg = NULL; /**< Testcase message. */ -static int at_success = 0; /**< Number of successful testcases. */ -static int at_failure = 0; /**< Number of failed testcases. */ - - -/* - * Global properties. - */ -static int at_verbose = 0; /**< Verbosity. */ -static int at_quiet = 0; /**< Quietness. */ - - -/* - * Prototypes. - */ -static void SDL_ATcleanup (void); -static void SDL_ATendWith( int success ); -static void SDL_ATassertFailed( const char *msg ); - - -/** - * @brief Cleans up the automated testsuite state. - */ -static void SDL_ATcleanup (void) -{ - if (at_suite_msg != NULL) - SDL_free(at_suite_msg); - at_suite_msg = NULL; - if (at_test_msg != NULL) - SDL_free(at_test_msg); - at_test_msg = NULL; - at_success = 0; - at_failure = 0; -} - - -/** - * @brief Begin testsuite. - */ -void SDL_ATinit( const char *suite ) -{ - /* Do not open twice. */ - if (at_suite_msg) { - SDL_ATprintErr( "AT suite '%s' not closed before opening suite '%s'\n", - at_suite_msg, suite ); - } - /* Must have a name. */ - if (suite == NULL) { - SDL_ATprintErr( "AT testsuite does not have a name.\n"); - } - SDL_ATcleanup(); - at_suite_msg = SDL_strdup(suite); - - /* Verbose message. */ - SDL_ATprintVerbose( 2, "--+---> Started Test Suite '%s'\n", at_suite_msg ); -} - - -/** - * @brief Finish testsuite. - */ -int SDL_ATfinish (void) -{ - int failed; - - /* Make sure initialized. */ - if (at_suite_msg == NULL) { - SDL_ATprintErr("Ended testcase without initializing.\n"); - return 1; - } - - /* Finished without closing testcase. */ - if (at_test_msg) { - SDL_ATprintErr( "AT suite '%s' finished without closing testcase '%s'\n", - at_suite_msg, at_test_msg ); - } - - /* Verbose message. */ - SDL_ATprintVerbose( 2, "<-+---- Finished Test Suite '%s'\n", at_suite_msg ); - - /* Display message if verbose on failed. */ - failed = at_failure; - if (at_failure > 0) { - SDL_ATprintErr( "%s : Failed %d out of %d testcases!\n", - at_suite_msg, at_failure, at_failure+at_success ); - } - else { - SDL_ATprint( "%s : All tests successful (%d)\n", - at_suite_msg, at_success ); - } - - /* Clean up. */ - SDL_ATcleanup(); - - /* Return failed. */ - return failed; -} - - -/** - * @brief Sets a property. - */ -void SDL_ATseti( int property, int value ) -{ - switch (property) { - case SDL_AT_VERBOSE: - at_verbose = value; - break; - - case SDL_AT_QUIET: - at_quiet = value; - break; - } -} - - -/** - * @brief Gets a property. - */ -void SDL_ATgeti( int property, int *value ) -{ - switch (property) { - case SDL_AT_VERBOSE: - *value = at_verbose; - break; - - case SDL_AT_QUIET: - *value = at_quiet; - break; - } -} - - -/** - * @brief Begin testcase. - */ -void SDL_ATbegin( const char *testcase ) -{ - /* Do not open twice. */ - if (at_test_msg) { - SDL_ATprintErr( "AT testcase '%s' not closed before opening testcase '%s'\n", - at_test_msg, testcase ); - } - /* Must have a name. */ - if (testcase == NULL) { - SDL_ATprintErr( "AT testcase does not have a name.\n"); - } - at_test_msg = SDL_strdup(testcase); - - /* Verbose message. */ - SDL_ATprintVerbose( 2, " +---> StartedTest Case '%s'\n", testcase ); -} - - -/** - * @brief Ends the testcase with a succes or failure. - */ -static void SDL_ATendWith( int success ) -{ - /* Make sure initialized. */ - if (at_test_msg == NULL) { - SDL_ATprintErr("Ended testcase without initializing.\n"); - return; - } - - /* Mark as success or failure. */ - if (success) - at_success++; - else - at_failure++; - - /* Verbose message. */ - SDL_ATprintVerbose( 2, " +---- Finished Test Case '%s'\n", at_test_msg ); - - /* Clean up. */ - if (at_test_msg != NULL) - SDL_free(at_test_msg); - at_test_msg = NULL; -} - - -/** - * @brief Display failed assert message. - */ -static void SDL_ATassertFailed( const char *msg ) -{ - /* Print. */ - SDL_ATprintErr( "Assert Failed!\n" ); - SDL_ATprintErr( " %s\n", msg ); - SDL_ATprintErr( " Test Case '%s'\n", at_test_msg ); - SDL_ATprintErr( " Test Suite '%s'\n", at_suite_msg ); - SDL_ATprintErr( " Last SDL error '%s'\n", SDL_GetError() ); - /* End. */ - SDL_ATendWith(0); -} - - -/** - * @brief Testcase test. - */ -int SDL_ATassert( const char *msg, int condition ) -{ - /* Condition failed. */ - if (!condition) { - /* Failed message. */ - SDL_ATassertFailed(msg); - } - return !condition; -} - - -/** - * @brief Testcase test. - */ -int SDL_ATvassert( int condition, const char *msg, ... ) -{ - va_list args; - char buf[256]; - - /* Condition failed. */ - if (!condition) { - /* Get message. */ - va_start( args, msg ); - SDL_vsnprintf( buf, sizeof(buf), msg, args ); - va_end( args ); - /* Failed message. */ - SDL_ATassertFailed( buf ); - } - return !condition; -} - - -/** - * @brief End testcase. - */ -void SDL_ATend (void) -{ - SDL_ATendWith(1); -} - - -/** - * @brief Displays an error. - */ -int SDL_ATprintErr( const char *msg, ... ) -{ - va_list ap; - int ret; - - /* Make sure there is something to print. */ - if (msg == NULL) - return 0; - else { - va_start(ap, msg); - ret = vfprintf( stderr, msg, ap ); - va_end(ap); - } - - return ret; -} - - -/** - * @brief Displays a message. - */ -int SDL_ATprint( const char *msg, ... ) -{ - va_list ap; - int ret; - - /* Only print if not quiet. */ - if (at_quiet) - return 0; - - /* Make sure there is something to print. */ - if (msg == NULL) - return 0; - else { - va_start(ap, msg); - ret = vfprintf( stdout, msg, ap ); - va_end(ap); - } - - return ret; -} - - -/** - * @brief Displays a verbose message. - */ -int SDL_ATprintVerbose( int level, const char *msg, ... ) -{ - va_list ap; - int ret; - - /* Only print if not quiet. */ - if (at_quiet || (at_verbose < level)) - return 0; - - /* Make sure there is something to print. */ - if (msg == NULL) - return 0; - else { - va_start(ap, msg); - ret = vfprintf( stdout, msg, ap ); - va_end(ap); - } - - return ret; -} diff --git a/test/automated/SDL_at.h b/test/automated/SDL_at.h deleted file mode 100644 index 6bd9680bd..000000000 --- a/test/automated/SDL_at.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Common code for automated test suite. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -/** - * @file SDL_at.h - * - * @brief Handles automatic testing functionality. - * - * The basic approach with SDL_AT is to divide the tests into what are called - * test suites and test cases. Each test suite should have multiple test - * cases, each test case can have multiple asserts. - * - * To actually test for conditions within the testcase you check asserts, if - * the asserts fail the failures will be logged in the testsuite and - * displayed. - * - * Syntax is similar to OpenGL. An example would be: - * - * @code - * int f; // Number failed - * SDL_ATinit( "My testsuite" ); - * - * SDL_ATbegin( "My first testcase" ); - * if (!SDL_ATassert( (1+1)==2, "Trying '1+1=2'.")) - * return; // Implicitly calls SDL_ATend if assert fails - * SDL_ATend(); // Finish testcase - * - * SDL_ATbegin( "My second testcase" ); - * if (!SDL_ATassert( (4/2)==2, "Trying '4/2=2'.")) - * return; // Implicitly calls SDL_ATend if assert fails - * SDL_ATend(); // Finish testcase - * - * f = SDL_ATfinish(); - * @endcode - * - * @author Edgar Simo "bobbens" - */ - - -#ifndef _SDL_AT_H -# define _SDL_AT_H - - - -enum { - SDL_AT_VERBOSE, /**< Sets the verbose level. */ - SDL_AT_QUIET /**< Sets quietness. */ -}; - - -/* - * Suite level actions. - */ -/** - * @brief Starts the testsuite. - * - * @param suite Name of the suite to start testing. - */ -void SDL_ATinit( const char *suite ); -/** - * @brief Finishes the testsuite printing out global results if verbose. - * - * @return 0 if no errors occurred, otherwise number of failures. - */ -int SDL_ATfinish (void); -/** - * @brief Sets a global property value. - * - * @param property Property to set. - * @param value Value to set property to. - */ -void SDL_ATseti( int property, int value ); -/** - * @brief Gets a global property value. - * - * @param property Property to get. - * @param[out] value Value of the property. - */ -void SDL_ATgeti( int property, int *value ); - - -/* - * Testcase level actions. - */ -/** - * @brief Begins a testcase. - * - * @param testcase Name of the testcase to begin. - */ -void SDL_ATbegin( const char *testcase ); -/** - * @brief Checks a condition in the testcase. - * - * Will automatically call SDL_ATend if the condition isn't met. - * - * @param condition Condition to make sure is true. - * @param msg Message to display for failure. - * @return Returns 1 if the condition isn't met. - */ -int SDL_ATassert( const char *msg, int condition ); -/** - * @brief Checks a condition in the testcase. - * - * Will automatically call SDL_ATend if the condition isn't met. - * - * @param condition Condition to make sure is true. - * @param msg Message to display for failure with printf style formatting. - * @return Returns 1 if the condition isn't met. - */ -int SDL_ATvassert( int condition, const char *msg, ... ); -/** - * @brief Ends a testcase. - */ -void SDL_ATend (void); - - -/* - * Misc functions. - */ -/** - * @brief Prints an error. - * - * @param msg printf formatted string to display. - * @return Number of character printed. - */ -int SDL_ATprintErr( const char *msg, ... ); -/** - * @brief Prints some text. - * - * @param msg printf formatted string to display. - * @return Number of character printed. - */ -int SDL_ATprint( const char *msg, ... ); -/** - * @brief Prints some verbose text. - * - * Verbosity levels are as follows: - * - * - 0 standard stdout, enabled by default - * - 1 additional information - * - 2 detailed information (spammy) - * - * @param level Level of verbosity to print at. - * @param msg printf formatted string to display. - * @return Number of character printed. - */ -int SDL_ATprintVerbose( int level, const char *msg, ... ); - - -#endif /* _SDL_AT_H */ - - diff --git a/test/automated/audio/audio.c b/test/automated/audio/audio.c deleted file mode 100644 index 0712c396d..000000000 --- a/test/automated/audio/audio.c +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Automated SDL_RWops test. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#include "SDL.h" -#include "../SDL_at.h" - - -/** - * @brief Prints available devices. - */ -static int audio_printDevices( int iscapture ) -{ - int i, n; - - /* Get number of devices. */ - n = SDL_GetNumAudioDevices(iscapture); - SDL_ATprintVerbose( 1, "%d %s Audio Devices\n", - n, iscapture ? "Capture" : "Output" ); - - /* List devices. */ - for (i=0; iw != img->width) || (sur->h != img->height)) - return -1; - - SDL_LockSurface( sur ); - - ret = 0; - bpp = sur->format->BytesPerPixel; - - /* Compare image - should be same format. */ - for (j=0; jh; j++) { - for (i=0; iw; i++) { - p = (Uint8 *)sur->pixels + j * sur->pitch + i * bpp; - pd = (Uint8 *)img->pixel_data + (j*img->width + i) * img->bytes_per_pixel; - switch (bpp) { - case 1: - case 2: - case 3: - ret += 1; - /*printf("%d BPP not supported yet.\n",bpp);*/ - break; - - case 4: - { - int dist = 0; - Uint8 R, G, B, A; - - SDL_GetRGBA(*(Uint32*)p, sur->format, &R, &G, &B, &A); - - if (img->bytes_per_pixel == 3) { - dist += (R-pd[0])*(R-pd[0]); - dist += (G-pd[1])*(G-pd[1]); - dist += (B-pd[2])*(B-pd[2]); - } else { - dist += (R-pd[0])*(R-pd[0]); - dist += (G-pd[1])*(G-pd[1]); - dist += (B-pd[2])*(B-pd[2]); - dist += (A-pd[3])*(A-pd[3]); - } - /* Allow some difference in blending accuracy */ - if (dist > allowable_error) { - /*printf("pixel %d,%d varies by %d\n", i, j, dist);*/ - ++ret; - } - } - break; - } - } - } - - SDL_UnlockSurface( sur ); - - if (ret) { - SDL_SaveBMP(sur, "fail.bmp"); - - SDL_LockSurface( sur ); - - bpp = sur->format->BytesPerPixel; - - if (bpp == 4) { - for (j=0; jh; j++) { - for (i=0; iw; i++) { - Uint8 R, G, B, A; - p = (Uint8 *)sur->pixels + j * sur->pitch + i * bpp; - pd = (Uint8 *)img->pixel_data + (j*img->width + i) * img->bytes_per_pixel; - - R = pd[0]; - G = pd[1]; - B = pd[2]; - if (img->bytes_per_pixel == 4) { - A = pd[3]; - } else { - A = 0; - } - *(Uint32*)p = (A << 24) | (R << 16) | (G << 8) | B; - } - } - } - - SDL_UnlockSurface( sur ); - - SDL_SaveBMP(sur, "good.bmp"); - } - return ret; -} diff --git a/test/automated/common/common.h b/test/automated/common/common.h deleted file mode 100644 index 25e7ecf74..000000000 --- a/test/automated/common/common.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Automated SDL test common framework. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#ifndef COMMON_H -# define COMMON_H - - -# define FORMAT SDL_PIXELFORMAT_ARGB8888 -# define AMASK 0xff000000 /**< Alpha bit mask. */ -# define RMASK 0x00ff0000 /**< Red bit mask. */ -# define GMASK 0x0000ff00 /**< Green bit mask. */ -# define BMASK 0x000000ff /**< Blue bit mask. */ - - -typedef struct SurfaceImage_s { - int width; - int height; - unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ - const char *pixel_data; -} SurfaceImage_t; - -#define ALLOWABLE_ERROR_OPAQUE 0 -#define ALLOWABLE_ERROR_BLENDED 64 - -/** - * @brief Compares a surface and a surface image for equality. - * - * @param sur Surface to compare. - * @param img Image to compare against. - * @return 0 if they are the same, -1 on error and positive if different. - */ -int surface_compare( SDL_Surface *sur, const SurfaceImage_t *img, int allowable_error ); - - -#endif /* COMMON_H */ - diff --git a/test/automated/common/images.h b/test/automated/common/images.h deleted file mode 100644 index 4ee3a94fd..000000000 --- a/test/automated/common/images.h +++ /dev/null @@ -1,22 +0,0 @@ - - -#ifndef IMAGES_H -# define IMAGES_H - - -#include "common.h" - - -/* - * Pull in images for testcases. - */ -#include "img_primitives.c" -#include "img_primitivesblend.c" -#include "img_face.c" -#include "img_blit.c" -#include "img_blitblend.c" - - -#endif /* IMAGES_H */ - - diff --git a/test/automated/common/img_blit.c b/test/automated/common/img_blit.c deleted file mode 100644 index 85a1c7a0c..000000000 --- a/test/automated/common/img_blit.c +++ /dev/null @@ -1,1454 +0,0 @@ -/* GIMP RGB C-Source image dump (blit.c) */ - -static const SurfaceImage_t img_blit = { - 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", -}; -static const SurfaceImage_t img_blitColour = { - 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", -}; -static const SurfaceImage_t img_blitAlpha = { - 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", -}; - diff --git a/test/automated/common/img_blitblend.c b/test/automated/common/img_blitblend.c deleted file mode 100644 index 4f13de18e..000000000 --- a/test/automated/common/img_blitblend.c +++ /dev/null @@ -1,2690 +0,0 @@ -/* GIMP RGB C-Source image dump (alpha.c) */ - -static const SurfaceImage_t img_blendAdd = { - 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", -}; - -static const SurfaceImage_t img_blendBlend = { - 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", -}; - -static const SurfaceImage_t img_blendMod = { - 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", -}; - -static const SurfaceImage_t img_blendNone = { - 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", -}; - -static const SurfaceImage_t img_blendAll = { - 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", -}; - diff --git a/test/automated/common/img_face.c b/test/automated/common/img_face.c deleted file mode 100644 index 4bfe3cb85..000000000 --- a/test/automated/common/img_face.c +++ /dev/null @@ -1,196 +0,0 @@ -/* GIMP RGBA C-Source image dump (face.c) */ - -static const SurfaceImage_t img_face = { - 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", -}; - diff --git a/test/automated/common/img_primitives.c b/test/automated/common/img_primitives.c deleted file mode 100644 index e023a8d63..000000000 --- a/test/automated/common/img_primitives.c +++ /dev/null @@ -1,463 +0,0 @@ -/* GIMP RGB C-Source image dump (primitives.c) */ - -static const SurfaceImage_t img_primitives = { - 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", -}; - diff --git a/test/automated/common/img_primitivesblend.c b/test/automated/common/img_primitivesblend.c deleted file mode 100644 index 16132ce9b..000000000 --- a/test/automated/common/img_primitivesblend.c +++ /dev/null @@ -1,645 +0,0 @@ -/* GIMP RGB C-Source image dump (alpha.c) */ - -static const SurfaceImage_t img_blend = { - 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> 4) == 0x1) { - real_byteorder = SDL_BIG_ENDIAN; - } else { - real_byteorder = SDL_LIL_ENDIAN; - } - if (SDL_ATvassert( real_byteorder == SDL_BYTEORDER, - "Machine detected as %s endian but appears to be %s endian.", - (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big", - (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big" )) - return; - - /* Test 16 swap. */ - if (SDL_ATvassert( SDL_Swap16(value16) == swapped16, - "16 bit swapped incorrectly: 0x%X => 0x%X", - value16, SDL_Swap16(value16) )) - return; - - /* Test 32 swap. */ - if (SDL_ATvassert( SDL_Swap32(value32) == swapped32, - "32 bit swapped incorrectly: 0x%X => 0x%X", - value32, SDL_Swap32(value32) )) - return; - - /* Test 64 swap. */ - if (SDL_ATvassert( SDL_Swap64(value64) == swapped64, -#ifdef _MSC_VER - "64 bit swapped incorrectly: 0x%I64X => 0x%I64X", -#else - "64 bit swapped incorrectly: 0x%llX => 0x%llX", -#endif - value64, SDL_Swap64(value64) )) - return; - - SDL_ATend(); -} - - -/** - * @brief Platform test entrypoint. - */ -#ifdef TEST_STANDALONE -int main( int argc, const char *argv[] ) -{ - (void) argc; - (void) argv; -#else /* TEST_STANDALONE */ -int test_platform (void) -{ -#endif /* TEST_STANDALONE */ - - SDL_ATinit( "Platform" ); - - /* Debug information. */ - SDL_ATprintVerbose( 1, "%s System detected\n", SDL_GetPlatform() ); - SDL_ATprintVerbose( 1, "System is %s endian\n", -#ifdef SDL_LIL_ENDIAN - "little" -#else - "big" -#endif - ); - SDL_ATprintVerbose( 1, "CPU count: %d\n", SDL_GetCPUCount()); - SDL_ATprintVerbose( 1, "Available extensions:\n" ); - SDL_ATprintVerbose( 1, " RDTSC %s\n", SDL_HasRDTSC()? "detected" : "not detected" ); - SDL_ATprintVerbose( 1, " AltiVec %s\n", SDL_HasAltiVec()? "detected" : "not detected" ); - SDL_ATprintVerbose( 1, " MMX %s\n", SDL_HasMMX()? "detected" : "not detected" ); - SDL_ATprintVerbose( 1, " 3DNow! %s\n", SDL_Has3DNow()? "detected" : "not detected" ); - SDL_ATprintVerbose( 1, " SSE %s\n", SDL_HasSSE()? "detected" : "not detected" ); - SDL_ATprintVerbose( 1, " SSE2 %s\n", SDL_HasSSE2()? "detected" : "not detected" ); - SDL_ATprintVerbose( 1, " SSE3 %s\n", SDL_HasSSE3()? "detected" : "not detected" ); - SDL_ATprintVerbose( 1, " SSE4.1 %s\n", SDL_HasSSE41()? "detected" : "not detected" ); - SDL_ATprintVerbose( 1, " SSE4.2 %s\n", SDL_HasSSE42()? "detected" : "not detected" ); - - plat_testTypes(); - plat_testEndian(); - - return SDL_ATfinish(); -} diff --git a/test/automated/platform/platform.h b/test/automated/platform/platform.h deleted file mode 100644 index d8310e0c0..000000000 --- a/test/automated/platform/platform.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Part of SDL test suite. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#ifndef _TEST_PLATFORM -# define _TEST_PLATFORM - - -int test_platform (void); - - -#endif /* _TEST_PLATFORM */ - diff --git a/test/automated/rect/rect.c b/test/automated/rect/rect.c deleted file mode 100644 index 3ae2fc534..000000000 --- a/test/automated/rect/rect.c +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Automated SDL rect test. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - - - -#include "SDL_rect.h" -#include "../SDL_at.h" - - -/* - * Prototypes. - */ -static void rect_testIntersectRectAndLine (void); - - -/** - * @brief Tests SDL_IntersectRectAndLine() - */ -static void rect_testIntersectRectAndLine (void) -{ - SDL_Rect rect = { 0, 0, 32, 32 }; - int x1, y1; - int x2, y2; - SDL_bool clipped; - - SDL_ATbegin( "IntersectRectAndLine" ); - - x1 = -10; - y1 = 0; - x2 = -10; - y2 = 31; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( !clipped && - x1 == -10 && y1 == 0 && x2 == -10 && y2 == 31, - "line outside to the left was incorrectly clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - x1 = 40; - y1 = 0; - x2 = 40; - y2 = 31; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( !clipped && - x1 == 40 && y1 == 0 && x2 == 40 && y2 == 31, - "line outside to the right was incorrectly clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - x1 = 0; - y1 = -10; - x2 = 31; - y2 = -10; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( !clipped && - x1 == 0 && y1 == -10 && x2 == 31 && y2 == -10, - "line outside above was incorrectly clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - x1 = 0; - y1 = 40; - x2 = 31; - y2 = 40; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( !clipped && - x1 == 0 && y1 == 40 && x2 == 31 && y2 == 40, - "line outside below was incorrectly clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - x1 = 0; - y1 = 0; - x2 = 31; - y2 = 31; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( clipped && - x1 == 0 && y1 == 0 && x2 == 31 && y2 == 31, - "line fully inside rect was clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - x1 = -10; - y1 = 15; - x2 = 40; - y2 = 15; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( clipped && - x1 == 0 && y1 == 15 && x2 == 31 && y2 == 15, - "horizontal line rect was incorrectly clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - x1 = -32; - y1 = -32; - x2 = 63; - y2 = 63; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( clipped && - x1 == 0 && y1 == 0 && x2 == 31 && y2 == 31, - "diagonal line to lower right was incorrectly clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - x1 = 63; - y1 = 63; - x2 = -32; - y2 = -32; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( clipped && - x1 == 31 && y1 == 31 && x2 == 0 && y2 == 0, - "diagonal line to upper left was incorrectly clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - x1 = 63; - y1 = -32; - x2 = -32; - y2 = 63; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( clipped && - x1 == 31 && y1 == 0 && x2 == 0 && y2 == 31, - "diagonal line to lower left was incorrectly clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - x1 = -32; - y1 = 63; - x2 = 63; - y2 = -32; - clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - SDL_ATvassert( clipped && - x1 == 0 && y1 == 31 && x2 == 31 && y2 == 0, - "diagonal line to upper right was incorrectly clipped: %d,%d - %d,%d", - x1, y1, x2, y2); - - SDL_ATend(); -} - - -/** - * @brief Rect test entrypoint. - */ -#ifdef TEST_STANDALONE -int main( int argc, const char *argv[] ) -{ - (void) argc; - (void) argv; -#else /* TEST_STANDALONE */ -int test_rect (void) -{ -#endif /* TEST_STANDALONE */ - - SDL_ATinit( "Rect" ); - - rect_testIntersectRectAndLine(); - - return SDL_ATfinish(); -} diff --git a/test/automated/rect/rect.h b/test/automated/rect/rect.h deleted file mode 100644 index 9a0806151..000000000 --- a/test/automated/rect/rect.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Part of SDL test suite. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#ifndef _TEST_RECT -# define _TEST_RECT - - -int test_rect (void); - - -#endif /* _TEST_RECT */ - diff --git a/test/automated/render/render.c b/test/automated/render/render.c deleted file mode 100644 index 82f56ef6c..000000000 --- a/test/automated/render/render.c +++ /dev/null @@ -1,1082 +0,0 @@ -/** - * Automated SDL_Surface test. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#include "SDL.h" -#include "../SDL_at.h" - -#include "../common/common.h" - - -/* - * Pull in images for testcases. - */ -#include "../common/images.h" - - -#define SCREEN_W 80 -#define SCREEN_H 60 - -#define FACE_W img_face.width -#define FACE_H img_face.height - -static SDL_Renderer *renderer; - -/* - * Prototypes. - */ -static int render_compare( const char *msg, const SurfaceImage_t *s, int allowable_error ); -static int render_isSupported( int code ); -static int render_hasDrawColor (void); -static int render_hasBlendModes (void); -static int render_hasTexColor (void); -static int render_hasTexAlpha (void); -static int render_clearScreen (void); -/* Testcases. */ -static int render_testPrimitives (void); -static int render_testPrimitivesBlend (void); -static int render_testBlit (void); -static int render_testBlitColour (void); -static int render_testBlitAlpha (void); -static int render_testBlitBlendMode( SDL_Texture * tface, int mode ); -static int render_testBlitBlend (void); - - -/** - * @brief Compares screen pixels with image pixels. - * - * @param msg Message on failure. - * @param s Image to compare against. - * @return 0 on success. - */ -static int render_compare( const char *msg, const SurfaceImage_t *s, int allowable_error ) -{ - int ret; - SDL_Rect rect; - Uint8 pix[4*80*60]; - SDL_Surface *testsur; - - /* Read pixels. */ - /* Explicitly specify the rect in case the window isn't expected size... */ - rect.x = 0; - rect.y = 0; - rect.w = 80; - rect.h = 60; - ret = SDL_RenderReadPixels(renderer, &rect, FORMAT, pix, 80*4 ); - if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) ) - return 1; - - /* Create surface. */ - testsur = SDL_CreateRGBSurfaceFrom( pix, 80, 60, 32, 80*4, - RMASK, GMASK, BMASK, AMASK); - if (SDL_ATassert( "SDL_CreateRGBSurfaceFrom", testsur!=NULL )) - return 1; - - /* Compare surface. */ - ret = surface_compare( testsur, s, allowable_error ); - if (SDL_ATassert( msg, ret==0 )) - return 1; - - /* Clean up. */ - SDL_FreeSurface( testsur ); - - return 0; -} - -#if 0 -static int dump_screen( int index ) -{ - int ret; - char name[1024]; - Uint8 pix[4*80*60]; - SDL_Surface *testsur; - SDL_RendererInfo info; - - /* Read pixels. */ - ret = SDL_RenderReadPixels(renderer, NULL, FORMAT, pix, 80*4 ); - if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) ) - return 1; - - /* Create surface. */ - testsur = SDL_CreateRGBSurfaceFrom( pix, 80, 60, 32, 80*4, - RMASK, GMASK, BMASK, AMASK); - if (SDL_ATassert( "SDL_CreateRGBSurfaceFrom", testsur!=NULL )) - return 1; - - /* Dump surface. */ - SDL_GetRendererInfo(renderer,&info); - sprintf(name, "%s-%s-%d.bmp", SDL_GetCurrentVideoDriver(), info.name, index); - SDL_SaveBMP(testsur, name); - - /* Clean up. */ - SDL_FreeSurface( testsur ); - - return 0; -} -#endif - -/** - * @brief Checks to see if functionality is supported. - */ -static int render_isSupported( int code ) -{ - return (code == 0); -} - - -/** - * @brief Test to see if we can vary the draw colour. - */ -static int render_hasDrawColor (void) -{ - int ret, fail; - Uint8 r, g, b, a; - - fail = 0; - - /* Set colour. */ - ret = SDL_SetRenderDrawColor(renderer, 100, 100, 100, 100 ); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a ); - if (!render_isSupported(ret)) - fail = 1; - /* Restore natural. */ - ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE ); - if (!render_isSupported(ret)) - fail = 1; - - /* Something failed, consider not available. */ - if (fail) - return 0; - /* Not set properly, consider failed. */ - else if ((r != 100) || (g != 100) || (b != 100) || (a != 100)) - return 0; - return 1; -} - - -/** - * @brief Test to see if we can vary the blend mode. - */ -static int render_hasBlendModes (void) -{ - int fail; - int ret; - SDL_BlendMode mode; - - fail = 0; - - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND ); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); - if (!render_isSupported(ret)) - fail = 1; - ret = (mode != SDL_BLENDMODE_BLEND); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD ); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); - if (!render_isSupported(ret)) - fail = 1; - ret = (mode != SDL_BLENDMODE_ADD); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_MOD ); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); - if (!render_isSupported(ret)) - fail = 1; - ret = (mode != SDL_BLENDMODE_MOD); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); - if (!render_isSupported(ret)) - fail = 1; - ret = (mode != SDL_BLENDMODE_NONE); - if (!render_isSupported(ret)) - fail = 1; - - return !fail; -} - - -/** - * @brief Loads the test face. - */ -static SDL_Texture * render_loadTestFace (void) -{ - SDL_Surface *face; - SDL_Texture *tface; - - /* Create face surface. */ - face = SDL_CreateRGBSurfaceFrom( (void*)img_face.pixel_data, - img_face.width, img_face.height, 32, img_face.width*4, -#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 - ); - if (face == NULL) - return 0; - tface = SDL_CreateTextureFromSurface(renderer, face); - SDL_FreeSurface(face); - - return tface; -} - - -/** - * @brief Test to see if can set texture colour mode. - */ -static int render_hasTexColor (void) -{ - int fail; - int ret; - SDL_Texture *tface; - Uint8 r, g, b; - - /* Get test face. */ - tface = render_loadTestFace(); - if (tface == 0) - return 0; - - /* See if supported. */ - fail = 0; - ret = SDL_SetTextureColorMod( tface, 100, 100, 100 ); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_GetTextureColorMod( tface, &r, &g, &b ); - if (!render_isSupported(ret)) - fail = 1; - - /* Clean up. */ - SDL_DestroyTexture( tface ); - - if (fail) - return 0; - else if ((r != 100) || (g != 100) || (b != 100)) - return 0; - return 1; -} - - -/** - * @brief Test to see if we can vary the alpha of the texture. - */ -static int render_hasTexAlpha (void) -{ - int fail; - int ret; - SDL_Texture *tface; - Uint8 a; - - /* Get test face. */ - tface = render_loadTestFace(); - if (tface == 0) - return 0; - - /* See if supported. */ - fail = 0; - ret = SDL_SetTextureAlphaMod( tface, 100 ); - if (!render_isSupported(ret)) - fail = 1; - ret = SDL_GetTextureAlphaMod( tface, &a ); - if (!render_isSupported(ret)) - fail = 1; - - /* Clean up. */ - SDL_DestroyTexture( tface ); - - if (fail) - return 0; - else if (a != 100) - return 0; - return 1; -} - - -/** - * @brief Clears the screen. - * - * @note We don't test for errors, but they shouldn't happen. - */ -static int render_clearScreen (void) -{ - int ret; - - /* Set colour. */ - ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE ); - /* - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - */ - - /* Clear screen. */ - ret = SDL_RenderFillRect(renderer, NULL ); - /* - if (SDL_ATassert( "SDL_RenderFillRect", ret == 0)) - return -1; - */ - - /* Set defaults. */ - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); - /* - if (SDL_ATassert( "SDL_SetRenderDrawBlendMode", ret == 0)) - return -1; - */ - ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE ); - /* - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - */ - - return 0; -} - - -/** - * @brief Tests the SDL primitives for rendering. - */ -static int render_testPrimitives (void) -{ - int ret; - int x, y; - SDL_Rect rect; - - /* Clear surface. */ - if (render_clearScreen()) - return -1; - - /* Need drawcolour or just skip test. */ - if (!render_hasDrawColor()) - return 0; - - /* Draw a rectangle. */ - rect.x = 40; - rect.y = 0; - rect.w = 40; - rect.h = 80; - ret = SDL_SetRenderDrawColor(renderer, 13, 73, 200, SDL_ALPHA_OPAQUE ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_RenderFillRect(renderer, &rect ); - if (SDL_ATassert( "SDL_RenderFillRect", ret == 0)) - return -1; - - /* Draw a rectangle. */ - rect.x = 10; - rect.y = 10; - rect.w = 60; - rect.h = 40; - ret = SDL_SetRenderDrawColor(renderer, 200, 0, 100, SDL_ALPHA_OPAQUE ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_RenderFillRect(renderer, &rect ); - if (SDL_ATassert( "SDL_RenderFillRect", ret == 0)) - return -1; - - /* Draw some points like so: - * X.X.X.X.. - * .X.X.X.X. - * X.X.X.X.. */ - for (y=0; y<3; y++) { - x = y % 2; - for (; x<80; x+=2) { - ret = SDL_SetRenderDrawColor(renderer, x*y, x*y/2, x*y/3, SDL_ALPHA_OPAQUE ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_RenderDrawPoint(renderer, x, y ); - if (SDL_ATassert( "SDL_RenderDrawPoint", ret == 0)) - return -1; - } - } - - /* Draw some lines. */ - ret = SDL_SetRenderDrawColor(renderer, 0, 255, 0, SDL_ALPHA_OPAQUE ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_RenderDrawLine(renderer, 0, 30, 80, 30 ); - if (SDL_ATassert( "SDL_RenderDrawLine", ret == 0)) - return -1; - ret = SDL_SetRenderDrawColor(renderer, 55, 55, 5, SDL_ALPHA_OPAQUE ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_RenderDrawLine(renderer, 40, 30, 40, 60 ); - if (SDL_ATassert( "SDL_RenderDrawLine", ret == 0)) - return -1; - ret = SDL_SetRenderDrawColor(renderer, 5, 105, 105, SDL_ALPHA_OPAQUE ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_RenderDrawLine(renderer, 0, 0, 29, 29 ); - if (SDL_ATassert( "SDL_RenderDrawLine", ret == 0)) - return -1; - ret = SDL_RenderDrawLine(renderer, 29, 30, 0, 59 ); - if (SDL_ATassert( "SDL_RenderDrawLine", ret == 0)) - return -1; - ret = SDL_RenderDrawLine(renderer, 79, 0, 50, 29 ); - if (SDL_ATassert( "SDL_RenderDrawLine", ret == 0)) - return -1; - ret = SDL_RenderDrawLine(renderer, 79, 59, 50, 30 ); - if (SDL_ATassert( "SDL_RenderDrawLine", ret == 0)) - return -1; - - /* See if it's the same. */ - if (render_compare( "Primitives output not the same.", &img_primitives, ALLOWABLE_ERROR_OPAQUE )) - return -1; - - return 0; -} - - -/** - * @brief Tests the SDL primitives with alpha for rendering. - */ -static int render_testPrimitivesBlend (void) -{ - int ret; - int i, j; - SDL_Rect rect; - - /* Clear surface. */ - if (render_clearScreen()) - return -1; - - /* Need drawcolour and blendmode or just skip test. */ - if (!render_hasDrawColor() || !render_hasBlendModes()) - return 0; - - /* Create some rectangles for each blend mode. */ - ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, 0 ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); - if (SDL_ATassert( "SDL_SetRenderDrawBlendMode", ret == 0)) - return -1; - ret = SDL_RenderFillRect(renderer, NULL ); - if (SDL_ATassert( "SDL_RenderFillRect", ret == 0)) - return -1; - rect.x = 10; - rect.y = 25; - rect.w = 40; - rect.h = 25; - ret = SDL_SetRenderDrawColor(renderer, 240, 10, 10, 75 ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD ); - if (SDL_ATassert( "SDL_SetRenderDrawBlendMode", ret == 0)) - return -1; - ret = SDL_RenderFillRect(renderer, &rect ); - if (SDL_ATassert( "SDL_RenderFillRect", ret == 0)) - return -1; - rect.x = 30; - rect.y = 40; - rect.w = 45; - rect.h = 15; - ret = SDL_SetRenderDrawColor(renderer, 10, 240, 10, 100 ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND ); - if (SDL_ATassert( "SDL_SetRenderDrawBlendMode", ret == 0)) - return -1; - ret = SDL_RenderFillRect(renderer, &rect ); - if (SDL_ATassert( "SDL_RenderFillRect", ret == 0)) - return -1; - rect.x = 25; - rect.y = 25; - rect.w = 25; - rect.h = 25; - ret = SDL_SetRenderDrawColor(renderer, 10, 10, 240, 125 ); - if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0)) - return -1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); - if (SDL_ATassert( "SDL_SetRenderDrawBlendMode", ret == 0)) - return -1; - ret = SDL_RenderFillRect(renderer, &rect ); - if (SDL_ATassert( "SDL_RenderFillRect", ret == 0)) - return -1; - - /* Draw blended lines, lines for everyone. */ - for (i=0; i=0)) - goto err_cleanup; - SDL_ATprintVerbose( 1, " %d Render Drivers\n", nr ); - SDL_ATend(); - for (j=0; j -#include "SDL.h" - -#ifndef TestSupportRWops_h -#define TestSupportRWops_h - -FILE* TestSupportRWops_OpenFPFromReadDir(const char *file, const char *mode); -FILE* TestSupportRWops_OpenFPFromWriteDir(const char *file, const char *mode); -SDL_RWops* TestSupportRWops_OpenRWopsFromReadDir(const char *file, const char *mode); -SDL_RWops* TestSupportRWops_OpenRWopsFromWriteDir(const char *file, const char *mode); - - -#endif diff --git a/test/automated/rwops/TestSupportRWops_Cocoa.m b/test/automated/rwops/TestSupportRWops_Cocoa.m deleted file mode 100644 index 5f0dc07d3..000000000 --- a/test/automated/rwops/TestSupportRWops_Cocoa.m +++ /dev/null @@ -1,89 +0,0 @@ -#import "TestSupportRWops.h" -#import -#include "SDL.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. - Conversely, write directories are usually not in the bundles. This implementation uses NSTemporaryDirectory, - but consider Preferences, Application Support, Documents, etc. - Also, note the bundle layouts are different for iPhone and Mac. -*/ - -const char* RWOPS_READ = "rwops/read"; -const char* RWOPS_WRITE = "write"; - - -FILE* TestSupportRWops_OpenFPFromReadDir(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; -} - -FILE* TestSupportRWops_OpenFPFromWriteDir(const char *file, const char *mode) -{ - FILE* fp = NULL; - - NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init]; - - NSFileManager* file_manager = [NSFileManager defaultManager]; - NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)]; - NSString* full_path_with_file_to_try = [NSTemporaryDirectory() stringByAppendingPathComponent:ns_string_file_component]; - - fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode); - - [autorelease_pool drain]; - - return fp; -} - -SDL_RWops* TestSupportRWops_OpenRWopsFromReadDir(const char *file, const char *mode) -{ - return SDL_RWFromFile(file, mode); -} - -SDL_RWops* TestSupportRWops_OpenRWopsFromWriteDir(const char *file, const char *mode) -{ - SDL_RWops* rw = NULL; - - NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init]; - - NSFileManager* file_manager = [NSFileManager defaultManager]; - NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)]; - NSString* full_path_with_file_to_try = [NSTemporaryDirectory() stringByAppendingPathComponent:ns_string_file_component]; - - rw = SDL_RWFromFile( [full_path_with_file_to_try fileSystemRepresentation], mode ); - - [autorelease_pool drain]; - return rw; -} - diff --git a/test/automated/rwops/TestSupportRWops_Generic.c b/test/automated/rwops/TestSupportRWops_Generic.c deleted file mode 100644 index a4b366a34..000000000 --- a/test/automated/rwops/TestSupportRWops_Generic.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Generic implementation for file opening routines. -* Customizations for specific platforms should go in alternative files. -*/ - -// quiet windows compiler warnings -#define _CRT_SECURE_NO_WARNINGS - -#include -#include "SDL.h" - -const char* RWOPS_READ = "rwops/read"; -const char* RWOPS_WRITE = "rwops/write"; - -FILE* TestSupportRWops_OpenFPFromReadDir(const char *file, const char *mode) -{ - return fopen(file, mode); -} - -FILE* TestSupportRWops_OpenFPFromWriteDir(const char *file, const char *mode) -{ - return fopen(file, mode); -} - -SDL_RWops* TestSupportRWops_OpenRWopsFromReadDir(const char *file, const char *mode) -{ - return SDL_RWFromFile(file, mode); -} - -SDL_RWops* TestSupportRWops_OpenRWopsFromWriteDir(const char *file, const char *mode) -{ - return SDL_RWFromFile(file, mode); -} diff --git a/test/automated/rwops/read b/test/automated/rwops/read deleted file mode 100644 index c57eff55e..000000000 --- a/test/automated/rwops/read +++ /dev/null @@ -1 +0,0 @@ -Hello World! \ No newline at end of file diff --git a/test/automated/rwops/rwops.c b/test/automated/rwops/rwops.c deleted file mode 100644 index c3f236c3e..000000000 --- a/test/automated/rwops/rwops.c +++ /dev/null @@ -1,272 +0,0 @@ -/** - * Automated SDL_RWops test. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#include "SDL.h" -#include "../SDL_at.h" -#include "TestSupportRWops.h" - -/* Defined in TestSupportRWops implementation to allow flexibility. */ -extern const char* RWOPS_READ; -extern const char* RWOPS_WRITE; - -static const char hello_world[] = "Hello World!"; - - -/** - * @brief Makes sure parameters work properly. - */ -static void rwops_testParam (void) -{ - SDL_RWops *rwops; - - /* Begin testcase. */ - SDL_ATbegin( "RWops Parameters" ); - - /* These should all fail. */ - rwops = SDL_RWFromFile(NULL, NULL); - if (SDL_ATassert( "SDL_RWFromFile(NULL, NULL) worked", rwops == NULL )) - return; - rwops = SDL_RWFromFile(NULL, "ab+"); - if (SDL_ATassert( "SDL_RWFromFile(NULL, \"ab+\") worked", rwops == NULL )) - return; - rwops = SDL_RWFromFile(NULL, "sldfkjsldkfj"); - if (SDL_ATassert( "SDL_RWFromFile(NULL, \"sldfkjsldkfj\") worked", rwops == NULL )) - return; - rwops = SDL_RWFromFile("something", ""); - if (SDL_ATassert( "SDL_RWFromFile(\"something\", \"\") worked", rwops == NULL )) - return; - rwops = SDL_RWFromFile("something", NULL); - if (SDL_ATassert( "SDL_RWFromFile(\"something\", NULL) worked", rwops == NULL )) - return; - - - /* End testcase. */ - SDL_ATend(); -} - - -/** - * @brief Does a generic rwops test. - * - * RWops should have "Hello World!" in it already if write is disabled. - * - * @param write Test writing also. - * @return 1 if an assert is failed. - */ -static int rwops_testGeneric( SDL_RWops *rw, int write ) -{ - char buf[sizeof(hello_world)]; - Sint64 i; - - /* Set to start. */ - i = SDL_RWseek( rw, 0, RW_SEEK_SET ); - if (SDL_ATvassert( i == 0, - "Seeking with SDL_RWseek (RW_SEEK_SET): got %d, expected %d", - (int)i, 0 )) - return 1; - - /* Test write. */ - i = SDL_RWwrite( rw, hello_world, sizeof(hello_world)-1, 1 ); - if (write) { - if (SDL_ATassert( "Writing with SDL_RWwrite (failed to write)", i == 1 )) - return 1; - } - else { - if (SDL_ATassert( "Writing with SDL_RWwrite (wrote when shouldn't have)", i <= 0 )) - return 1; - } - - /* Test seek. */ - i = SDL_RWseek( rw, 6, RW_SEEK_SET ); - if (SDL_ATvassert( i == 6, - "Seeking with SDL_RWseek (RW_SEEK_SET): got %d, expected %d", - (int)i, 0 )) - return 1; - - /* Test seek. */ - i = SDL_RWseek( rw, 0, RW_SEEK_SET ); - if (SDL_ATvassert( i == 0, - "Seeking with SDL_RWseek (RW_SEEK_SET): got %d, expected %d", - (int)i, 0 )) - return 1; - - /* Test read. */ - i = SDL_RWread( rw, buf, 1, sizeof(hello_world)-1 ); - if (SDL_ATassert( "Reading with SDL_RWread", i == sizeof(hello_world)-1 )) - return 1; - if (SDL_ATassert( "Memory read does not match memory written", - SDL_memcmp( buf, hello_world, sizeof(hello_world)-1 ) == 0 )) - return 1; - - /* More seek tests. */ - i = SDL_RWseek( rw, -4, RW_SEEK_CUR ); - if (SDL_ATvassert( i == sizeof(hello_world)-5, - "Seeking with SDL_RWseek (RW_SEEK_CUR): got %d, expected %d", - (int)i, sizeof(hello_world)-5 )) - return 1; - i = SDL_RWseek( rw, -1, RW_SEEK_END ); - if (SDL_ATvassert( i == sizeof(hello_world)-2, - "Seeking with SDL_RWseek (RW_SEEK_END): got %d, expected %d", - (int)i, sizeof(hello_world)-2 )) - return 1; - - return 0; -} - - -/** - * @brief Tests opening from memory. - */ -static void rwops_testMem (void) -{ - char mem[sizeof(hello_world)]; - SDL_RWops *rw; - - /* Begin testcase. */ - SDL_ATbegin( "SDL_RWFromMem" ); - - /* Open. */ - rw = SDL_RWFromMem( mem, sizeof(hello_world)-1 ); - if (SDL_ATassert( "Opening memory with SDL_RWFromMem", rw != NULL )) - return; - - /* Run generic tests. */ - if (rwops_testGeneric( rw, 1 )) - return; - - /* Close. */ - SDL_FreeRW( rw ); - - /* End testcase. */ - SDL_ATend(); -} - - -static const char const_mem[] = "Hello World!"; -/** - * @brief Tests opening from memory. - */ -static void rwops_testConstMem (void) -{ - SDL_RWops *rw; - - /* Begin testcase. */ - SDL_ATbegin( "SDL_RWFromConstMem" ); - - /* Open. */ - rw = SDL_RWFromConstMem( const_mem, sizeof(const_mem)-1 ); - if (SDL_ATassert( "Opening memory with SDL_RWFromConstMem", rw != NULL )) - return; - - /* Run generic tests. */ - if (rwops_testGeneric( rw, 0 )) - return; - - /* Close. */ - SDL_FreeRW( rw ); - - /* End testcase. */ - SDL_ATend(); -} - - -/** - * @brief Tests opening from memory. - */ -static void rwops_testFile (void) -{ - SDL_RWops *rw; - - /* Begin testcase. */ - SDL_ATbegin( "SDL_RWFromFile" ); - - /* Read test. */ - rw = TestSupportRWops_OpenRWopsFromReadDir( RWOPS_READ, "r" ); - if (SDL_ATassert( "Opening memory with SDL_RWFromFile RWOPS_READ", rw != NULL )) - return; - if (rwops_testGeneric( rw, 0 )) - return; - SDL_FreeRW( rw ); - - /* Write test. */ - rw = TestSupportRWops_OpenRWopsFromWriteDir( RWOPS_WRITE, "w+" ); - if (SDL_ATassert( "Opening memory with SDL_RWFromFile RWOPS_WRITE", rw != NULL )) - return; - if (rwops_testGeneric( rw, 1 )) - return; - SDL_FreeRW( rw ); - - /* End testcase. */ - SDL_ATend(); -} - - -/** - * @brief Tests opening from memory. - */ -static void rwops_testFP (void) -{ -#ifdef HAVE_STDIO_H - FILE *fp; - SDL_RWops *rw; - - /* Begin testcase. */ - SDL_ATbegin( "SDL_RWFromFP" ); - - /* Run read tests. */ - fp = TestSupportRWops_OpenFPFromReadDir( RWOPS_READ, "r" ); - if (SDL_ATassert( "Failed to open file 'WOPS_READ", fp != NULL)) - return; - rw = SDL_RWFromFP( fp, 1 ); - if (SDL_ATassert( "Opening memory with SDL_RWFromFP", rw != NULL )) - return; - if (rwops_testGeneric( rw, 0 )) - return; - SDL_FreeRW( rw ); - - /* Run write tests. */ - fp = TestSupportRWops_OpenFPFromWriteDir( RWOPS_WRITE, "w+" ); - if (SDL_ATassert( "Failed to open file RWOPS_WRITE", fp != NULL)) - return; - rw = SDL_RWFromFP( fp, 1 ); - if (SDL_ATassert( "Opening memory with SDL_RWFromFP", rw != NULL )) - return; - if (rwops_testGeneric( rw, 1 )) - return; - SDL_FreeRW( rw ); - - /* End testcase. */ - SDL_ATend(); -#endif /* HAVE_STDIO_H */ -} - - -/** - * @brief Entry point. - */ -#ifdef TEST_STANDALONE -int main( int argc, const char *argv[] ) -{ - (void) argc; - (void) argv; -#else /* TEST_STANDALONE */ -int test_rwops (void) -{ -#endif /* TEST_STANDALONE */ - - SDL_ATinit( "SDL_RWops" ); - - rwops_testParam(); - rwops_testMem(); - rwops_testConstMem(); - rwops_testFile(); - rwops_testFP(); - - return SDL_ATfinish(); -} diff --git a/test/automated/rwops/rwops.h b/test/automated/rwops/rwops.h deleted file mode 100644 index 676e7f886..000000000 --- a/test/automated/rwops/rwops.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Part of SDL test suite. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#ifndef _TEST_RWOPS -# define _TEST_RWOPS - - -int test_rwops (void); - - -#endif /* _TEST_RWOPS */ - diff --git a/test/automated/surface/surface.c b/test/automated/surface/surface.c deleted file mode 100644 index 037cde924..000000000 --- a/test/automated/surface/surface.c +++ /dev/null @@ -1,450 +0,0 @@ -/** - * Automated SDL_Surface test. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#include "SDL.h" -#include "SDL_surface.h" -#include "SDL_video.h" -#include "../SDL_at.h" - -#include "../common/common.h" - - -/* - * Pull in images for testcases. - */ -#include "../common/images.h" - - -/* - * Prototypes. - */ -/* Testcases. */ -static void surface_testLoad( SDL_Surface *testsur ); -static void surface_testBlit( SDL_Surface *testsur ); -static int surface_testBlitBlendMode( SDL_Surface *testsur, SDL_Surface *face, SDL_BlendMode bMode ); -static void surface_testBlitBlend( SDL_Surface *testsur ); - - -/** - * @brief Tests sprite loading. - */ -static void surface_testLoad( SDL_Surface *testsur ) -{ - int ret; - SDL_Surface *face, *rface; - - SDL_ATbegin( "Load Test" ); - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - if (SDL_ATassert( "SDL_FillRect", ret == 0)) - return; - - /* Create the blit surface. */ -#ifdef __APPLE__ - face = SDL_LoadBMP("icon.bmp"); -#else - face = SDL_LoadBMP("../icon.bmp"); -#endif - - if (SDL_ATassert( "SDL_CreateLoadBmp", face != NULL)) - return; - - /* Set transparent pixel as the pixel at (0,0) */ - if (face->format->palette) { - ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels); - if (SDL_ATassert( "SDL_SetColorKey", ret == 0)) - return; - } - - /* Convert to 32 bit to compare. */ - rface = SDL_ConvertSurface( face, testsur->format, 0 ); - if (SDL_ATassert( "SDL_ConvertSurface", rface != NULL)) - return; - - /* See if it's the same. */ - if (SDL_ATassert( "Primitives output not the same.", - surface_compare( rface, &img_face, 0 )==0 )) - return; - - /* Clean up. */ - SDL_FreeSurface( rface ); - SDL_FreeSurface( face ); - - SDL_ATend(); -} - - -/** - * @brief Tests some blitting routines. - */ -static void surface_testBlit( SDL_Surface *testsur ) -{ - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - - SDL_ATbegin( "Blit Tests" ); - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - if (SDL_ATassert( "SDL_FillRect", ret == 0)) - return; - - /* Create face surface. */ - face = SDL_CreateRGBSurfaceFrom( (void*)img_face.pixel_data, - img_face.width, img_face.height, 32, img_face.width*4, -#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 - ); - if (SDL_ATassert( "SDL_CreateRGBSurfaceFrom", face != NULL)) - return; - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - /* Loop blit. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - if (SDL_ATassert( "SDL_BlitSurface", ret == 0)) - return; - } - } - - /* See if it's the same. */ - if (SDL_ATassert( "Blitting output not the same (normal blit).", - surface_compare( testsur, &img_blit, 0 )==0 )) - return; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - if (SDL_ATassert( "SDL_FillRect", ret == 0)) - return; - - /* Test blitting with colour mod. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - /* Set colour mod. */ - ret = SDL_SetSurfaceColorMod( face, (255/nj)*j, (255/ni)*i, (255/nj)*j ); - if (SDL_ATassert( "SDL_SetSurfaceColorMod", ret == 0)) - return; - - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - if (SDL_ATassert( "SDL_BlitSurface", ret == 0)) - return; - } - } - - /* See if it's the same. */ - if (SDL_ATassert( "Blitting output not the same (using SDL_SetSurfaceColorMod).", - surface_compare( testsur, &img_blitColour, 0 )==0 )) - return; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - if (SDL_ATassert( "SDL_FillRect", ret == 0)) - return; - - /* Restore colour. */ - ret = SDL_SetSurfaceColorMod( face, 255, 255, 255 ); - if (SDL_ATassert( "SDL_SetSurfaceColorMod", ret == 0)) - return; - - /* Test blitting with colour mod. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - /* Set alpha mod. */ - ret = SDL_SetSurfaceAlphaMod( face, (255/ni)*i ); - if (SDL_ATassert( "SDL_SetSurfaceAlphaMod", ret == 0)) - return; - - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - if (SDL_ATassert( "SDL_BlitSurface", ret == 0)) - return; - } - } - - /* See if it's the same. */ - if (SDL_ATassert( "Blitting output not the same (using SDL_SetSurfaceAlphaMod).", - surface_compare( testsur, &img_blitAlpha, 0 )==0 )) - return; - - /* Clean up. */ - SDL_FreeSurface( face ); - - SDL_ATend(); -} - - -/** - * @brief Tests a blend mode. - */ -static int surface_testBlitBlendMode( SDL_Surface *testsur, SDL_Surface *face, SDL_BlendMode bMode ) -{ - int ret; - int i, j, ni, nj; - SDL_Rect rect; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - if (SDL_ATassert( "SDL_FillRect", ret == 0)) - return 1; - - /* Steps to take. */ - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - - /* Test blend mode. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - /* Set blend mode. */ - ret = SDL_SetSurfaceBlendMode( face, bMode ); - if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0)) - return 1; - - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - if (SDL_ATassert( "SDL_BlitSurface", ret == 0)) - return 1; - } - } - - return 0; -} - - -/** - * @brief Tests some more blitting routines. - */ -static void surface_testBlitBlend( SDL_Surface *testsur ) -{ - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - int mode; - SDL_BlendMode bMode; - - SDL_ATbegin( "Blit Blending Tests" ); - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - if (SDL_ATassert( "SDL_FillRect", ret == 0)) - return; - - /* Create the blit surface. */ - face = SDL_CreateRGBSurfaceFrom( (void*)img_face.pixel_data, - img_face.width, img_face.height, 32, img_face.width*4, -#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 - ); - if (SDL_ATassert( "SDL_CreateRGBSurfaceFrom", face != NULL)) - return; - - /* Set alpha mod. */ - ret = SDL_SetSurfaceAlphaMod( face, 100 ); - if (SDL_ATassert( "SDL_SetSurfaceAlphaMod", ret == 0)) - return; - - /* Steps to take. */ - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - - /* Test None. */ - if (surface_testBlitBlendMode( testsur, face, SDL_BLENDMODE_NONE )) - return; - if (SDL_ATassert( "Blitting blending output not the same (using SDL_BLENDMODE_NONE).", - surface_compare( testsur, &img_blendNone, 0 )==0 )) - return; - - /* Test Blend. */ - if (surface_testBlitBlendMode( testsur, face, SDL_BLENDMODE_BLEND )) - return; - if (SDL_ATassert( "Blitting blending output not the same (using SDL_BLENDMODE_BLEND).", - surface_compare( testsur, &img_blendBlend, 0 )==0 )) - return; - - /* Test Add. */ - if (surface_testBlitBlendMode( testsur, face, SDL_BLENDMODE_ADD )) - return; - if (SDL_ATassert( "Blitting blending output not the same (using SDL_BLENDMODE_ADD).", - surface_compare( testsur, &img_blendAdd, 0 )==0 )) - return; - - /* Test Mod. */ - if (surface_testBlitBlendMode( testsur, face, SDL_BLENDMODE_MOD )) - return; - if (SDL_ATassert( "Blitting blending output not the same (using SDL_BLENDMODE_MOD).", - surface_compare( testsur, &img_blendMod, 0 )==0 )) - return; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - if (SDL_ATassert( "SDL_FillRect", ret == 0)) - return; - - /* Loop blit. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - - /* Set colour mod. */ - ret = SDL_SetSurfaceColorMod( face, (255/nj)*j, (255/ni)*i, (255/nj)*j ); - if (SDL_ATassert( "SDL_SetSurfaceColorMod", ret == 0)) - return; - - /* Set alpha mod. */ - ret = SDL_SetSurfaceAlphaMod( face, (100/ni)*i ); - if (SDL_ATassert( "SDL_SetSurfaceAlphaMod", ret == 0)) - return; - - /* Crazy blending mode magic. */ - mode = (i/4*j/4) % 4; - if (mode==0) bMode = SDL_BLENDMODE_NONE; - else if (mode==1) bMode = SDL_BLENDMODE_BLEND; - else if (mode==2) bMode = SDL_BLENDMODE_ADD; - else if (mode==3) bMode = SDL_BLENDMODE_MOD; - ret = SDL_SetSurfaceBlendMode( face, bMode ); - if (SDL_ATassert( "SDL_SetSurfaceBlendMode", ret == 0)) - return; - - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - if (SDL_ATassert( "SDL_BlitSurface", ret == 0)) - return; - } - } - - /* Check to see if matches. */ - if (SDL_ATassert( "Blitting blending output not the same (using SDL_BLEND_*).", - surface_compare( testsur, &img_blendAll, 0 )==0 )) - return; - - /* Clean up. */ - SDL_FreeSurface( face ); - - SDL_ATend(); -} - - -/** - * @brief Runs all the tests on the surface. - * - * @param testsur Surface to run tests on. - */ -void surface_runTests( SDL_Surface *testsur ) -{ - /* Software surface blitting. */ - surface_testBlit( testsur ); - surface_testBlitBlend( testsur ); -} - - -/** - * @brief Entry point. - */ -#ifdef TEST_STANDALONE -int main( int argc, const char *argv[] ) -{ - (void) argc; - (void) argv; -#else /* TEST_STANDALONE */ -int test_surface (void) -{ -#endif /* TEST_STANDALONE */ - int ret; - SDL_Surface *testsur; - - SDL_ATinit( "SDL_Surface" ); - - SDL_ATbegin( "Initializing" ); - /* Initializes the SDL subsystems. */ - ret = SDL_Init(0); - if (SDL_ATassert( "SDL_Init(0)", ret == 0)) - goto err; - - /* Now run on the video mode. */ - ret = SDL_InitSubSystem( SDL_INIT_VIDEO ); - if (SDL_ATassert( "SDL_InitSubSystem( SDL_INIT_VIDEO )", ret == 0)) - goto err; - - /* - * Surface on surface tests. - */ - /* Create the test surface. */ - testsur = SDL_CreateRGBSurface( 0, 80, 60, 32, - RMASK, GMASK, BMASK, AMASK ); - if (SDL_ATassert( "SDL_CreateRGBSurface", testsur != NULL)) - goto err; - SDL_ATend(); - /* Run surface on surface tests. */ - surface_testLoad( testsur ); - surface_runTests( testsur ); - /* Clean up. */ - SDL_FreeSurface( testsur ); - - /* Exit SDL. */ - SDL_Quit(); - - return SDL_ATfinish(); - -err: - return SDL_ATfinish(); -} - diff --git a/test/automated/surface/surface.h b/test/automated/surface/surface.h deleted file mode 100644 index cc1c89846..000000000 --- a/test/automated/surface/surface.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Part of SDL test suite. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#ifndef _TEST_SURFACE -# define _TEST_SURFACE - - -int test_surface (void); - - -#endif /* _TEST_SURFACE */ - diff --git a/test/automated/testsdl.c b/test/automated/testsdl.c deleted file mode 100644 index 9d9f037b1..000000000 --- a/test/automated/testsdl.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * SDL test suite framework code. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - -#include "SDL.h" -#include "SDL_at.h" - -#include "platform/platform.h" -#include "rwops/rwops.h" -#include "rect/rect.h" -#include "surface/surface.h" -#include "render/render.h" -#include "audio/audio.h" - -#if defined(WIN32) -#define NO_GETOPT -#endif -#if defined(__QNXNTO__) -#define NO_GETOPT_LONG 1 -#endif /* __QNXNTO__ */ - -#include /* printf */ -#include /* exit */ -#ifndef NO_GETOPT -#include /* getopt */ -#if !defined(NO_GETOPT_LONG) -#include /* getopt_long */ -#endif /* !NO_GETOPT_LONG */ -#endif /* !NO_GETOPT */ - - -/* - * Tests to run. - */ -static int run_manual = 0; /**< Run manual tests. */ -/* Manual. */ -/* Automatic. */ -static int run_platform = 1; /**< Run platform tests. */ -static int run_rwops = 1; /**< Run RWops tests. */ -static int run_rect = 1; /**< Run rect tests. */ -static int run_surface = 1; /**< Run surface tests. */ -static int run_render = 1; /**< Run render tests. */ -static int run_audio = 1; /**< Run audio tests. */ - -/* - * Prototypes. - */ -static void print_usage( const char *name ); -static void parse_options( int argc, char *argv[] ); - - -/** - * @brief Displays program usage. - */ -static void print_usage( const char *name ) -{ - printf("Usage: %s [OPTIONS]\n", name); - printf("Options are:\n"); - printf(" -m, --manual enables tests that require user interaction\n"); - printf(" --noplatform do not run the platform tests\n"); - printf(" --norwops do not run the rwops tests\n"); - printf(" --norect do not run the rect tests\n"); - printf(" --nosurface do not run the surface tests\n"); - printf(" --norender do not run the render tests\n"); - printf(" --noaudio do not run the audio tests\n"); - printf(" -v, --verbose increases verbosity level by 1 for each -v\n"); - printf(" -q, --quiet only displays errors\n"); - printf(" -h, --help display this message and exit\n"); -} - -/** - * @brief Handles the options. - */ -static void parse_options( int argc, char *argv[] ) -{ - int i; - - for (i = 1; i < argc; ++i) { - const char *arg = argv[i]; - if (SDL_strcmp(arg, "-m") == 0 || SDL_strcmp(arg, "--manual") == 0) { - run_manual = 1; - continue; - } - if (SDL_strcmp(arg, "-v") == 0 || SDL_strcmp(arg, "--verbose") == 0) { - int level; - SDL_ATgeti( SDL_AT_VERBOSE, &level ); - SDL_ATseti( SDL_AT_VERBOSE, level+1 ); - continue; - } - if (SDL_strcmp(arg, "-q") == 0 || SDL_strcmp(arg, "--quiet") == 0) { - SDL_ATseti( SDL_AT_QUIET, 1 ); - SDL_setenv("SDL_ASSERT", "abort", 0); - continue; - } - if (SDL_strcmp(arg, "--noplatform") == 0) { - run_platform = 0; - continue; - } - if (SDL_strcmp(arg, "--norwops") == 0) { - run_rwops = 0; - continue; - } - if (SDL_strcmp(arg, "--norect") == 0) { - run_rect = 0; - continue; - } - if (SDL_strcmp(arg, "--nosurface") == 0) { - run_surface = 0; - continue; - } - if (SDL_strcmp(arg, "--norender") == 0) { - run_render = 0; - continue; - } - if (SDL_strcmp(arg, "--noaudio") == 0) { - run_audio = 0; - continue; - } - - /* Print help and exit! */ - print_usage( argv[0] ); - exit(EXIT_FAILURE); - } -} - -/** - * @brief Main entry point. - */ -int main( int argc, char *argv[] ) -{ - int failed; - const char *rev; - SDL_version ver; - - /* Get options. */ - parse_options( argc, argv ); - - /* Defaults. */ - failed = 0; - - /* Print some text if verbose. */ - SDL_GetVersion( &ver ); - rev = SDL_GetRevision(); - SDL_ATprintVerbose( 1, "Running tests with SDL %d.%d.%d revision %s\n", - ver.major, ver.minor, ver.patch, rev ); - - /* Automatic tests. */ - if (run_platform) - failed += test_platform(); - if (run_rwops) - failed += test_rwops(); - if (run_rect) - failed += test_rect(); - if (run_surface) - failed += test_surface(); - if (run_render) - failed += test_render(); - if (run_audio) - failed += test_audio(); - - /* Manual tests. */ - if (run_manual) { - } - - /* Display more information if failed. */ - if (failed > 0) { - SDL_ATprintErr( "Tests run with SDL %d.%d.%d revision %d\n", - ver.major, ver.minor, ver.patch, rev ); - SDL_ATprintErr( "System is running %s and is %s endian\n", - SDL_GetPlatform(), -#if SDL_BYTEORDER == SDL_LIL_ENDIAN - "little" -#else - "big" -#endif - ); - } - - return failed; -} - diff --git a/test/checkkeys.c b/test/checkkeys.c index 49dc277b2..61e8be043 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -11,7 +11,7 @@ */ /* Simple program: Loop, watching keystrokes - Note that you need to call SDL_PollEvent() or SDL_WaitEvent() to + Note that you need to call SDL_PollEvent() or SDL_WaitEvent() to pump the event loop and catch keystrokes. */ @@ -107,24 +107,6 @@ PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat) SDL_GetScancodeName(sym->scancode), pressed ? "pressed " : "released"); } - - /* Print the translated character, if one exists */ - if (sym->unicode) { - /* Is it a control-character? */ - if (sym->unicode < ' ') { - print_string(&spot, &left, " (^%c)", sym->unicode + '@'); - } else { -#ifdef UNICODE - print_string(&spot, &left, " (%c)", sym->unicode); -#else - /* This is a Latin-1 program, so only show 8-bits */ - if (!(sym->unicode & 0xFF00)) - print_string(&spot, &left, " (%c)", sym->unicode); - else - print_string(&spot, &left, " (0x%X)", sym->unicode); -#endif - } - } print_modifiers(&spot, &left); if (repeat) { print_string(&spot, &left, " (repeat)"); @@ -135,7 +117,15 @@ PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat) static void PrintText(char *text) { - SDL_Log("Text: %s\n", text); + unsigned char *spot, expanded[1024]; + + expanded[0] = '\0'; + for ( spot = text; *spot; ++spot ) + { + size_t length = SDL_strlen(expanded); + SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", *spot); + } + SDL_Log("Text (%s): \"%s%s\"\n", expanded, *text == '"' ? "\\" : "", text); } int diff --git a/test/configure b/test/configure index f91d30d9a..319c03298 100755 --- a/test/configure +++ b/test/configure @@ -585,6 +585,7 @@ ac_unique_file="README" ac_subst_vars='LTLIBOBJS LIBOBJS SDL_TTF_LIB +XLIB GLLIB CPP XMKMF @@ -3793,6 +3794,7 @@ if test x$have_x = xyes; then : else XPATH="-L$ac_x_libraries" + XLIB="-L$ac_x_libraries -lX11" fi fi @@ -3865,6 +3867,7 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTF_Init in -lSDL2_ttf" >&5 $as_echo_n "checking for TTF_Init in -lSDL2_ttf... " >&6; } if ${ac_cv_lib_SDL2_ttf_TTF_Init+:} false; then : diff --git a/test/configure.in b/test/configure.in index b89b4617d..b74800758 100644 --- a/test/configure.in +++ b/test/configure.in @@ -100,6 +100,7 @@ if test x$have_x = xyes; then : else XPATH="-L$ac_x_libraries" + XLIB="-L$ac_x_libraries -lX11" fi fi @@ -141,6 +142,7 @@ else fi AC_SUBST(GLLIB) +AC_SUBST(XLIB) dnl Check for SDL_ttf AC_CHECK_LIB(SDL2_ttf, TTF_Init, have_SDL_ttf=yes) diff --git a/test/loopwave.c b/test/loopwave.c index d929459bc..de8329af1 100644 --- a/test/loopwave.c +++ b/test/loopwave.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -12,8 +12,8 @@ /* Program to load a wave file and loop playing it using SDL sound */ -/* loopwaves.c is much more robust in handling WAVE files -- - This is only for simple WAVEs +/* loopwaves.c is much more robust in handling WAVE files -- + This is only for simple WAVEs */ #include "SDL_config.h" diff --git a/test/relative_mode.markdown b/test/relative_mode.markdown new file mode 100644 index 000000000..9ae88aa1c --- /dev/null +++ b/test/relative_mode.markdown @@ -0,0 +1,56 @@ +Relative mode testing +===================== + +See test program at the bottom of this file. + +Initial tests: + + - When in relative mode, the mouse shouldn't be moveable outside of the window. + - When the cursor is outside the window when relative mode is enabled, mouse + clicks should not go to whatever app was under the cursor previously. + - When alt/cmd-tabbing between a relative mode app and another app, clicks when + in the relative mode app should also not go to whatever app was under the + cursor previously. + + +Code +==== + + #include + + int PollEvents() + { + SDL_Event event; + while (SDL_PollEvent(&event)) + { + switch (event.type) + { + case SDL_QUIT: + return 1; + default: + break; + } + } + + return 0; + } + + int main(int argc, char *argv[]) + { + SDL_Init(SDL_INIT_VIDEO); + + SDL_Window *win = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, 0); + SDL_SetRelativeMouseMode(SDL_TRUE); + + while (1) + { + if (PollEvents()) + break; + } + + SDL_DestroyWindow(win); + + SDL_Quit(); + + return 0; + } diff --git a/test/test-automation/AUTHORS b/test/test-automation/AUTHORS deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test-automation/COPYING b/test/test-automation/COPYING deleted file mode 100644 index 9620b5afa..000000000 --- a/test/test-automation/COPYING +++ /dev/null @@ -1,24 +0,0 @@ -Note: - -The copyright below applies to source code in src/ and its -subdirectories unless otherwise noted. - -====== - -Copyright (C) 2011 Markus Kauppila - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as 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/test/test-automation/ChangeLog b/test/test-automation/ChangeLog deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test-automation/DoxyFile b/test/test-automation/DoxyFile deleted file mode 100644 index 89ced195c..000000000 --- a/test/test-automation/DoxyFile +++ /dev/null @@ -1,1473 +0,0 @@ -# Doxyfile 1.5.7.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# 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 = Test Runner - -# 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 = - -# 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/ - -# 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 = NO - -# 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, 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, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# 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. - -BRIEF_MEMBER_DESC = YES - -# 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. - -REPEAT_BRIEF = YES - -# 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 = - -# 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. - -ALWAYS_DETAILED_SEC = 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. - -INLINE_INHERITED_MEMB = 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. - -FULL_PATH_NAMES = YES - -# 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. - -STRIP_FROM_PATH = - -# 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. - -STRIP_FROM_INC_PATH = - -# 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. - -SHORT_NAMES = 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 regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# 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.) - -QT_AUTOBRIEF = YES - -# 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. - -MULTILINE_CPP_IS_BRIEF = 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 -# re-implements. - -INHERIT_DOCS = YES - -# 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. - -SEPARATE_MEMBER_PAGES = 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. - -TAB_SIZE = 4 - -# 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. - -ALIASES = - -# 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. - -OPTIMIZE_OUTPUT_FOR_C = 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. - -OPTIMIZE_OUTPUT_JAVA = NO - -# 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. - -OPTIMIZE_FOR_FORTRAN = NO - -# 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. - -OPTIMIZE_OUTPUT_VHDL = NO - -# 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 = NO - -# 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 = NO - -# 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 = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# 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 = NO - -# 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 = 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. - -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. - -HIDE_FRIEND_COMPOUNDS = NO - -# 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. - -HIDE_IN_BODY_DOCS = NO - -# 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 = NO - -# 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 -# declaration order. - -SORT_MEMBER_DOCS = YES - -# 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. - -SORT_BRIEF_DOCS = NO - -# 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. - -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 -# 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 -# 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 -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# 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. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# 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 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. - -SHOW_USED_FILES = YES - -# 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. - -SHOW_DIRECTORIES = NO - -# 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. - -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. - -FILE_VERSION_FILTER = - -# 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 -# 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 -# 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 -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# 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 = NO - -# 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 -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# 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 -# with spaces. - -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 *.h README - -# 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 = 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 -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# 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. 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 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 -# blank all files are included. - -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. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# 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 = - -# 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 = - -# 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 - -#--------------------------------------------------------------------------- -# 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. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = 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. - -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 = NO - -# 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 = NO - -# 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 documentstion. - -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 -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# 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 -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# 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 -# 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 -# 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 -# standard 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 -# standard 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. 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 = - -# 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 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 = NO - -# 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 = "Doxygen generated docs" - -# 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.doxygen.Project - -# 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 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 = - -# 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 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 = YES - -# 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 = YES - -# 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. - -GENERATE_QHP = NO - -# 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 -# Qt Help Project / Namespace. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# Qt Help Project / Virtual Folders. - -QHP_VIRTUAL_FOLDER = doc - -# 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 = 4 - -# 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 = NONE - -# 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 -# 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 -# 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. - -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 -# 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 -# 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 -# 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 -# packages that should be included in the LaTeX output. - -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 -# standard header. Notice: only use this tag if you know what you are doing! - -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 -# This makes the output suitable for online browsing using a pdf viewer. - -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 -# higher quality PDF documentation. - -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. -# 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 - -#--------------------------------------------------------------------------- -# 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 optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -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 -# 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 -# 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. -# 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 assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config 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 -# generate man pages - -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 -# 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 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 -# would be unable to find the correct page. The default is NO. - -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. - -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 -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# 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 -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# 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 = NO - -# 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 preprocessor. - -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 -# be used. - -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. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# 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 = - -# 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::additions related to external references -#--------------------------------------------------------------------------- - -# 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 = - -# 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 -# be listed. - -EXTERNAL_GROUPS = YES - -# 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 - -#--------------------------------------------------------------------------- -# 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 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. - -MSCGEN_PATH = - -# 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 -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# 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. - -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 = 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 -# class references variables) of the class with other documented classes. - -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 - -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 - -# 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 = 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 -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# 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 - -# 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 in the 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 -# \dotfile command). - -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_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_DEPTH = 0 - -# 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). - -DOT_TRANSPARENT = NO - -# 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 = 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 -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# 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::additions related to the search engine -#--------------------------------------------------------------------------- - -# 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 diff --git a/test/test-automation/INSTALL b/test/test-automation/INSTALL deleted file mode 100644 index 69c97ab10..000000000 --- a/test/test-automation/INSTALL +++ /dev/null @@ -1,18 +0,0 @@ -Installation Instructions -************************* - -To compile the project use the following commands: - - ./autogen.sh - ./configure - make - -Then you're ready to test. Run the harness with the following command: - - ./runner - -To view the command line options for the harness use: ./runner --help - -For more information, check out project's wiki at: -https://bitbucket.org/Markusk/sdl-gsoc/wiki/Home - \ No newline at end of file diff --git a/test/test-automation/Makefile.am b/test/test-automation/Makefile.am deleted file mode 100644 index 79e73f169..000000000 --- a/test/test-automation/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -ACLOCAL_AMFLAGS = -I acinclude -I build-scripts - -SUBDIRS = src/libSDLtest \ - src/runner \ - tests/testdummy \ - tests/testrect \ - tests/testplatform \ - tests/testaudio \ - tests/testsurface \ - tests/testrwops \ - tests/testrender \ - tests/testvideo \ - tests/testsyswm \ - tests/testclipboard \ - tests/testevents \ - tests/testkeyboard - -install: install-runner install-tests -install-runner: - $(SHELL) build-scripts/install-runner.sh -install-tests: - $(SHELL) build-scripts/install-tests.sh - -distclean-local: - $(SHELL) build-scripts/distclean.sh - diff --git a/test/test-automation/NEWS b/test/test-automation/NEWS deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test-automation/README b/test/test-automation/README deleted file mode 100644 index e511fda38..000000000 --- a/test/test-automation/README +++ /dev/null @@ -1,12 +0,0 @@ -/*! \mainpage Documentation for SDL test harness - -\section Introduction - -This is doxygen-generated docs for SDL test harness. - -Pull the project with Mercurial: -hg clone https://Markusk@bitbucket.org/Markusk/sdl-gsoc/wiki - -For more information: https://bitbucket.org/Markusk/sdl-gsoc/wiki/Home - -*/ diff --git a/test/test-automation/TODO b/test/test-automation/TODO deleted file mode 100644 index 7de36a279..000000000 --- a/test/test-automation/TODO +++ /dev/null @@ -1,11 +0,0 @@ -- Add proper Tracelog function to logging system. It should be possible - for a test writer to send information to logs for further investigation. - This would replace the current Log(time_t, char *fmt, ...) function - in practice. - -- If running tests with --in-proc option failing asserts - don't bail out from the test case as it should. Fix this. - -- Might be good idea to warn the user if runner is given command line - options that doesn't make sense together. Cases such as using --xsl - without --xml option or --iterations combined with --exec-key diff --git a/test/test-automation/acinclude/libtool.m4 b/test/test-automation/acinclude/libtool.m4 deleted file mode 100644 index 6edf0391b..000000000 --- a/test/test-automation/acinclude/libtool.m4 +++ /dev/null @@ -1,7359 +0,0 @@ -# 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. -# Written by Gordon Matzigkeit, 1996 -# -# 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. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 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. -]) - -# serial 56 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_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_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# 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 -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH - -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 - -# 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 - -# 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 - -_LT_CC_BASENAME([$compiler]) - -# 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 - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - -## ------------------------------------- ## -## Accumulate code for creating libtool. ## -## ------------------------------------- ## - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - -## ------------------------ ## -## FIXME: Eliminate VARNAME ## -## ------------------------ ## - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# 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"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# 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"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# 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' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - 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_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -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 - -cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -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. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test $[#] != 0 -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# 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_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [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. -# -_LT_COPYING -_LT_LIBTOOL_TAGS - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### 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 - - _LT_PROG_LTMAIN - - # 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_XSI_SHELLFNS - - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -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)]) -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], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# 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 -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -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* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -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* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [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" >&AS_MESSAGE_LOG_FD - $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 - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - 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 - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" - ]) - 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" != ":"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _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)='' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_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=echo - _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}" - _LT_TAGVAR(module_expsym_cmds, $1)="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}" - m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$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}" - _LT_TAGVAR(archive_expsym_cmds, $1)="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 - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- -# 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. -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 -])# _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 - - -# _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. -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! - : -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 -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 - - 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 - -# 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 - -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_PROG_ECHO_BACKSLASH - - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -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 AC_TRY_EVAL(ac_compile); 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 __oline__ "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 - *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 AC_TRY_EVAL(ac_compile); 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" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - 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 - ;; -sparc*-*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" ;; - *) - 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" -])# _LT_ENABLE_LOCK - - -# _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]) - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# 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 \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi -_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_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # 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:__oline__: $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 - 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 - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - 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>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - 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; - ;; - - 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 - ;; - - 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"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$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 -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -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" -#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 - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -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 - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) - ]) - ]) - ]) - ]) - ]) - ;; - 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" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - 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 -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=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:__oline__: $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 - 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 - $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 - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $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* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - 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 - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[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]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != 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, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = 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 -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -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" - AC_MSG_RESULT([yes]) -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" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl -m4_require([_LT_DECL_SED])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test "$GCC" = yes; then - case $host_os in - 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 - # 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 - # 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; } -}'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` -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 - 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 - 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=`$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' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - 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,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) - 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}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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`' -m4_if([$1], [],[ - 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 - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[[123]]*) 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 - 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 - 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' - ;; - -interix[[3-9]]*) - version_type=linux - 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 - 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 Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux - 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 - 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 - - # 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;/^$/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 - 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 - 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 - 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 - 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 - 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 - 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 -AC_MSG_RESULT([$dynamic_linker]) -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 - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[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]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program which can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[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 -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - 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]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program which can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - 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 - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[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 &1 /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 - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - 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 - ;; - -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]) 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 Linux ELF. -linux* | k*bsd*-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 -]) -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 - -_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"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[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]) -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"], :) - AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_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 "$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 "$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) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - - -# 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*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_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' - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# 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};"\ -" /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 - - # 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 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 - # 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 -#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. */ -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_save_LIBS="$LIBS" - lt_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" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - 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 -]) -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 - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -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], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_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_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_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 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-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 - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - 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_TAGVAR(lt_prog_compiler_pic, $1)=-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_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--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 - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+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_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC - _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\ 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)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # 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' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-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 - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - 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_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-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). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # 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 - _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\ 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' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _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]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -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' - 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 - 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' - 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' - ;; - *) - _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)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _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 - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # 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'. - _LT_TAGVAR(exclude_expsyms, $1)=['_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. -dnl Note also adjust exclude_expsyms for C++ above. - 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 - - _LT_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = 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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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 - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *\ [[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 - _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 -*** 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. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$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)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - 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 - _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' - - 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' - # 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 $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _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) - 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= - 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' - 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' - 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 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - 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(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$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~ - $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*) - # 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' - 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' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _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' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=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 - _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' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _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' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - 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' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=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 - 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' - 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 - 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. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${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 - _LT_TAGVAR(hardcode_direct, $1)=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 - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - 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 - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_TAGVAR(always_export_symbols, $1)=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. - _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_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" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_SYS_MODULE_PATH_AIX - _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' - _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' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$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)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-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. - _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 - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _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 - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - 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 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # 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(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - 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' - 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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - 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' - 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 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$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 -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _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' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - 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' - # 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" - 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' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _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(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' - 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' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - 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(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_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' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _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_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' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='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}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=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 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=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. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _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' - 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. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _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' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_TAGVAR(archive_cmds, $1) 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. - 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)]) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_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], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [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]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - 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], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_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([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_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_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$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);}' - -_LT_TAG_COMPILER -# 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 -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -## 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_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report which library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - 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 - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -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_DECL_EGREP])dnl - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_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 -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_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(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$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. - _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_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++"} - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - 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_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - LT_PATH_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 - _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(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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 - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - 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. - _LT_TAGVAR(archive_cmds, $1)='$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 "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=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. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${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 - _LT_TAGVAR(hardcode_direct, $1)=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 - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - 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 - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_TAGVAR(always_export_symbols, $1)=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. - _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_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" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_SYS_MODULE_PATH_AIX - _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' - _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' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - 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 - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - gnu*) - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=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 - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$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; $ECHO "X$list" | $Xsed' - ;; - *) - 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' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=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 - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$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; $ECHO "X$list" | $Xsed' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _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 -fPIC ${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 - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _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' - ;; - irix5* | irix6*) - 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' - - # 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. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - 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' - 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' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-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. - _LT_TAGVAR(archive_cmds, $1)='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' - _LT_TAGVAR(archive_expsym_cmds, $1)='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; $ECHO "X$list" | $Xsed' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$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."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$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 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *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`"' - _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`~ - $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' - _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' - ;; - *) # Version 6 will 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' - ;; - esac - - _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' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$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 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # 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=`$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' - ;; - xl*) - # 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' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$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~ - $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 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _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(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' - - # 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. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=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*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _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 - else - _LT_TAGVAR(ld_shlibs, $1)=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. - _LT_TAGVAR(archive_cmds, $1)='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' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - 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(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_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~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # 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=`$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' - ;; - *) - 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}-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' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # 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"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _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)='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' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=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?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # 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. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$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. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - 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_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' - - # 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"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -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 -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 "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - 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(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - 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(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$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 - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$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... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - 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_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -]) -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); 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 $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 - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p 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 "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${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 "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - ;; - - *.$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 "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[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. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; - -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 - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC*) - # 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 - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _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) - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_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 -_LT_TAGVAR(inherit_rpath, $1)=no -_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(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 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_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # 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_GCC=$GCC - CC=${F77-"f77"} - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - 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 - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$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... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" -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) - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_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 -_LT_TAGVAR(inherit_rpath, $1)=no -_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(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC 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_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # 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_GCC=$GCC - CC=${FC-"f95"} - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - 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 - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$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... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" -fi # test "$_lt_disable_FC" != yes - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# 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_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# GCJ 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 - -## 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" -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# 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_GCC=$GCC -GCC= -CC=${RC-"windres"} -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC="$lt_save_CC" -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# 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 -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_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 -} - -# 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_EOF - ;; - *) # Bourne compatible functions. - 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 () -{ - # 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 file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - -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. - -# 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 -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' - -# 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/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} - -# 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_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF - ;; - *) - 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 - ;; - esac -]) diff --git a/test/test-automation/acinclude/ltoptions.m4 b/test/test-automation/acinclude/ltoptions.m4 deleted file mode 100644 index 34151a3ba..000000000 --- a/test/test-automation/acinclude/ltoptions.m4 +++ /dev/null @@ -1,368 +0,0 @@ -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004, 2005, 2007, 2008 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 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - ]) -])# _LT_SET_OPTIONS - - -## --------------------------------- ## -## Macros to handle LT_INIT options. ## -## --------------------------------- ## - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [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], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [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], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [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], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT options. -# 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], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - -## ----------------- ## -## LTDL_INIT Options ## -## ----------------- ## - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -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/test/test-automation/acinclude/ltsugar.m4 b/test/test-automation/acinclude/ltsugar.m4 deleted file mode 100644 index 9000a057d..000000000 --- a/test/test-automation/acinclude/ltsugar.m4 +++ /dev/null @@ -1,123 +0,0 @@ -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2008 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 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - 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/test/test-automation/acinclude/ltversion.m4 b/test/test-automation/acinclude/ltversion.m4 deleted file mode 100644 index f3c530980..000000000 --- a/test/test-automation/acinclude/ltversion.m4 +++ /dev/null @@ -1,23 +0,0 @@ -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 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. - -# Generated from ltversion.in. - -# serial 3017 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.2.6b]) -m4_define([LT_PACKAGE_REVISION], [1.3017]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6b' -macro_revision='1.3017' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) diff --git a/test/test-automation/acinclude/lt~obsolete.m4 b/test/test-automation/acinclude/lt~obsolete.m4 deleted file mode 100644 index 637bb2066..000000000 --- a/test/test-automation/acinclude/lt~obsolete.m4 +++ /dev/null @@ -1,92 +0,0 @@ -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007 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 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -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])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -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])]) diff --git a/test/test-automation/aclocal.m4 b/test/test-automation/aclocal.m4 deleted file mode 100644 index b8717a5aa..000000000 --- a/test/test-automation/aclocal.m4 +++ /dev/null @@ -1,991 +0,0 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, -[m4_warning([this file was generated for autoconf 2.65. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) - -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# -# 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. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# 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. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. -# -# 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 9 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. -# -# 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 10 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# 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 5 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. -# -# 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 16 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl -]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) - -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. -# -# 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. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# 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 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. -# -# 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 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# 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 - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# 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 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# -# 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. - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. -# -# 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 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. -# -# 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 5 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# 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. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. -# -# 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 2 - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -# -# 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 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -m4_include([acinclude/libtool.m4]) -m4_include([acinclude/ltoptions.m4]) -m4_include([acinclude/ltsugar.m4]) -m4_include([acinclude/ltversion.m4]) -m4_include([acinclude/lt~obsolete.m4]) diff --git a/test/test-automation/autogen.sh b/test/test-automation/autogen.sh deleted file mode 100755 index fd7bb31a9..000000000 --- a/test/test-automation/autogen.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh - -echo "Generating build information using autoreconf" -echo "This may take a while..." - -test -d acinclude || mkdir acinclude - -autoreconf -i - -# Run configure for this platform -echo "Now you are ready to run ./configure" diff --git a/test/test-automation/build-scripts/compile b/test/test-automation/build-scripts/compile deleted file mode 100755 index c0096a7b5..000000000 --- a/test/test-automation/build-scripts/compile +++ /dev/null @@ -1,143 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. - -scriptversion=2009-10-06.20; # UTC - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software -# Foundation, Inc. -# Written by Tom Tromey . -# -# 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 2, 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 to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand `-c -o'. -Remove `-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file `INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; -esac - -ofile= -cfile= -eat= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we strip `-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use `[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/test/test-automation/build-scripts/config.guess b/test/test-automation/build-scripts/config.guess deleted file mode 100755 index c2246a4f7..000000000 --- a/test/test-automation/build-scripts/config.guess +++ /dev/null @@ -1,1502 +0,0 @@ -#! /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, 2010 -# Free Software Foundation, Inc. - -timestamp='2009-12-30' - -# 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 -# the Free Software Foundation; either version 2 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -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, 2009, 2010 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." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -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*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # 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 ;; - 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 - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - 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" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # 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} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # 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 ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[456]) - 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 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 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" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #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); - - 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 - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - 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 ;; - 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}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - 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} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - 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 - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - 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 - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64: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 - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - 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, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - 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. - # 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 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /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; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - 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 - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - 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` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - 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 < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -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` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/test/test-automation/build-scripts/config.sub b/test/test-automation/build-scripts/config.sub deleted file mode 100755 index c2d125724..000000000 --- a/test/test-automation/build-scripts/config.sub +++ /dev/null @@ -1,1714 +0,0 @@ -#! /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, 2010 -# Free Software Foundation, Inc. - -timestamp='2010-01-22' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# 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 -# the Free Software Foundation; either version 2 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -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, 2009, 2010 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." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# 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* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | 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 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | 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 \ - | ubicom32 \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-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. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | 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-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | 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-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | 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-* | tilegx-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - 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 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze) - basic_machine=microblaze-xilinx - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - 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 - ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; - tile*) - basic_machine=tile-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # 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|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -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* | -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* \ - | -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* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/test/test-automation/build-scripts/depcomp b/test/test-automation/build-scripts/depcomp deleted file mode 100755 index df8eea7e4..000000000 --- a/test/test-automation/build-scripts/depcomp +++ /dev/null @@ -1,630 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2009-04-28.21; # UTC - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. - -# 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 2, 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 to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" - depmode=msvisualcpp -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" - echo >> "$depfile" - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/test/test-automation/build-scripts/distclean.sh b/test/test-automation/build-scripts/distclean.sh deleted file mode 100755 index fa47ceefd..000000000 --- a/test/test-automation/build-scripts/distclean.sh +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/bash - -DIRECTORY="tests" -EXT="error" - -PLATFORM="$(uname)" -if [[ $PLATFORM == "Linux" ]]; then - EXT="so" -elif [[ $PLATFORM == "Darwin" ]]; then - EXT="dylib" -fi - -echo "Debug: $DIRECTORY/*.$EXT" - -rm -f $DIRECTORY/*.$EXT -rm -f runner -rm -f *.bmp diff --git a/test/test-automation/build-scripts/install-runner.sh b/test/test-automation/build-scripts/install-runner.sh deleted file mode 100755 index bef675389..000000000 --- a/test/test-automation/build-scripts/install-runner.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/bash - -cp src/runner/.libs/runner . -chmod u+x runner - -PLATFORM="$(uname)" -if [[ $PLATFORM == "Linux" ]]; then - cp -f src/libSDLtest/.libs/libSDLtest.so.0 /usr/local/lib -elif [[ $PLATFORM == "Darwin" ]]; then - cp -f src/libSDLtest/.libs/libSDLtest.0.dylib /usr/local/lib -fi - -echo "Runner installed." diff --git a/test/test-automation/build-scripts/install-sh b/test/test-automation/build-scripts/install-sh deleted file mode 100755 index 6781b987b..000000000 --- a/test/test-automation/build-scripts/install-sh +++ /dev/null @@ -1,520 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2009-04-28.21; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# 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 -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium 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 X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/test/test-automation/build-scripts/install-tests.sh b/test/test-automation/build-scripts/install-tests.sh deleted file mode 100755 index fdbd707d0..000000000 --- a/test/test-automation/build-scripts/install-tests.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/bash - -DIRECTORY="tests" -EXT="error" - -mkdir $DIRECTORY > /dev/null 2>&1 - -PLATFORM="$(uname)" -if [[ $PLATFORM == "Linux" ]]; then - EXT="so" -elif [[ $PLATFORM == "Darwin" ]]; then - EXT="dylib" -fi - -# TODO: put the test in an array -for suite in "testdummy" "testplatform" "testrect" "testaudio" "testsurface" "testrwops" "testrender" "testvideo" "testsyswm" "testclipboard" "testevents" "testkeyboard" -do - cp -f "$DIRECTORY/$suite/.libs/lib$suite.$EXT" $DIRECTORY -done - -echo "Test suites installed." -echo "Run './runner --show-tests' to see the available tests" -echo "and './runner' to execute them" -echo "" -echo "For more commands: './runner --help'" diff --git a/test/test-automation/build-scripts/ltmain.sh b/test/test-automation/build-scripts/ltmain.sh deleted file mode 100755 index a72f2fd78..000000000 --- a/test/test-automation/build-scripts/ltmain.sh +++ /dev/null @@ -1,8406 +0,0 @@ -# Generated from ltmain.m4sh. - -# ltmain.sh (GNU libtool) 2.2.6b -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 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. - -# 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. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# 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 -# -# 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 -# -# MODE-ARGS vary depending on the MODE. -# 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.6b -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=2.2.6b -TIMESTAMP="" -package_revision=1.3017 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs 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 -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# 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 -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done - -$lt_unset CDPATH - - - - - -: ${CP="cp -f"} -: ${ECHO="echo"} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SED="/bin/sed"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# 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 () -{ - # 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"` -} - -# Generated shell functions inserted here. - -# 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" - -# 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 - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=: - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# 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='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/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. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname${mode+: }$mode: $*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname${mode+: }$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 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - 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"` - done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "X$my_tmpdir" | $Xsed -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -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="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - - - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $SED -n '/^# Usage:/,/# -h/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - $ECHO - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help -# Echo long help message to standard output and exit. -func_help () -{ - $SED -n '/^# Usage:/,/# Report bugs to/ { - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - 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`"'/ - p - }' < "$progpath" - exit $? -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - func_error "missing argument for $1" - exit_cmd=exit -} - -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 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. -{ - - # 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 - opt="$1" - shift - - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" - 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 | -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" - shift - ;; - - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: - ;; - - --verbose| -v) preserve_args="$preserve_args $opt" - opt_silent=false - ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here - shift - ;; - - # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} - shift - ;; - - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break - ;; - esac - done - - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps - ;; - esac - - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} - -# 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 -} - - -## ----------- ## -## Main. ## -## ----------- ## - -$opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - test -z "$mode" && func_fatal_error "error: you must specify a MODE." - - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - - # 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." -} - - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# 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_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$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. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - 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" - done - 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` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - 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" - done - case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T <?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # 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} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - removelist="$removelist $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - removelist="$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_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - command="$command -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { -test "$mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -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 - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -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 - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -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 - -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) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$mode'" - ;; - esac - - $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 - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - # 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" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir="$func_dirname_result" - ;; - - *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - $ECHO "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # 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\" - - $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 - exit $EXIT_SUCCESS -} - -test "$mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # 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 - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # 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" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # 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" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - dir="$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\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - 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%"` - else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e '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 - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test "$mode" = install && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $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` - for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $opt_dry_run || { - $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - 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'" - } - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - $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 -lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - $ECHO >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # 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*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$symtab_cflags $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - 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%"` - else - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # 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@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# 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. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - - - -# func_extract_an_archive dir oldlib -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 ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - - -# func_emit_wrapper_part1 [arg=no] -# -# 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 () -{ - func_emit_wrapper_part1_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part1_arg1=$1 - fi - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# 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 -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs 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 -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# 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 - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -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\ -" - $ECHO "\ - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e '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'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"X\$file\" | \$Xsed -e '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 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # 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/::*\$//'\` - - 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 - 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 - 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 -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#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 -#include -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# 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 - -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# 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 -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - 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); -} -#else -# define LTWRAPPER_DEBUGPRINTF(args) -#endif - -const char *program_name = NULL; - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -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_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 <"))); - for (i = 0; i < newargc; i++) - { - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); - } - -EOF - - case $host_os in - mingw*) - cat <<"EOF" - /* execv doesn't actually work on mingw as expected on unix */ - 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)); - return 127; - } - return rval; -EOF - ;; - *) - cat <<"EOF" - execv (lt_argv_zero, newargz); - return rval; /* =127, but avoids unused variable warning */ -EOF - ;; - esac - - cat <<"EOF" -} - -void * -xmalloc (size_t num) -{ - void *p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), - string) : NULL; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char) name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable (const char *path) -{ - struct stat st; - - LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", - tmp_pathspec)); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - char *errstr = strerror (errno); - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal ("Could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} - -void -lt_setenv (const char *name, const char *value) -{ - LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", - (name ? name : ""), - (value ? value : ""))); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - 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 : ""))); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_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 : ""))); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - - -EOF -} -# end: func_emit_cwrapperexe_src - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file \`$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - weak_libs="$weak_libs $arg" - prev= - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - compiler_flags="$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" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname '-L' '' "$arg" - dir=$func_stripname_result - if test -z "$dir"; 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 - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # 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" - 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" - 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" ;; - esac - continue - ;; - - -multi_module) - single_module="${wl}-multi_module" - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - 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" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - 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" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - 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 - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) - 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" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" - - 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\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # 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 - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - 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" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - case $lib in - *.la) func_source "$lib" ;; - 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"` - case " $weak_libs " in - *" $deplib_base "*) ;; - *) deplibs="$deplibs $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - dir=$func_stripname_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - 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 \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $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." - else - $ECHO - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - 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" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # 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'` - 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";; - esac - done - fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e '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" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - 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" - 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 - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # 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" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # 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 - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - 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 - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) temp_rpath="$temp_rpath$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc*) - # No point in relinking DLLs because paths are not encoded - notinst_deplibs="$notinst_deplibs $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - $ECHO - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname="$1" - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - 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" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # 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" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # 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" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $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." - 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." - 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." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$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 "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_dirname "$deplib" "" "." - dir="$func_dirname_result" - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - 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}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - 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'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - 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 "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - 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) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - libobjs="$libobjs $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # 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" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$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"` - #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" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$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*) - # 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" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "X$potlib" | $Xsed -e '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" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $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" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - 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 | \ - $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $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" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - newdeplibs="$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'` - 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,,"` - done - fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $ECHO - if test "X$deplibs_check_method" = "Xnone"; then - $ECHO "*** Warning: inter-library dependencies are not supported in this platform." - else - $ECHO "*** Warning: inter-library dependencies are not known to be supported." - fi - $ECHO "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - 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 /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $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." - 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." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - 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." - - 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." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # 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'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - 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" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - 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 - 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:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$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" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd 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 - func_show_eval "$cmd" 'exit $?' - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - 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"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # 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" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$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" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - 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 - for obj in $save_libobjs - do - $ECHO "$obj" >> $output - done - $ECHO ')' >> $output - delfiles="$delfiles $output" - 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" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - $ECHO "$obj" >> $output - done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # 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\" - 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\" - 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 - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # 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\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - delfiles="$delfiles $output" - - else - output= - fi - - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - if ${skipped_export-false}; then - 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"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # 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" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$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 - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - 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'` - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # 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 - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - 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 /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - 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" - ;; - 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'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - 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` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *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 - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "X$compile_command" | $Xsed -e '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=$?' - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi - - exit $exit_status - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # 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'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - 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'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e '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 $?' - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - 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"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $dlprefiles - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $ECHO "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - 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 - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - 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"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - 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" - ;; - *) newdlfiles="$newdlfiles $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - 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" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - 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 ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$mode" = link || test "$mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # 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" - 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" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # 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}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - 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 - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$mode" = uninstall || test "$mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -# vi:sw=2 - diff --git a/test/test-automation/build-scripts/missing b/test/test-automation/build-scripts/missing deleted file mode 100755 index 28055d2ae..000000000 --- a/test/test-automation/build-scripts/missing +++ /dev/null @@ -1,376 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2009-04-28.21; # UTC - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# 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 2, 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 to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - -esac - -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; - - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/test/test-automation/config.h.in b/test/test-automation/config.h.in deleted file mode 100644 index 32063649c..000000000 --- a/test/test-automation/config.h.in +++ /dev/null @@ -1,86 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the `fork' function. */ -#undef HAVE_FORK - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vfork' function. */ -#undef HAVE_VFORK - -/* Define to 1 if you have the header file. */ -#undef HAVE_VFORK_H - -/* Define to 1 if `fork' works. */ -#undef HAVE_WORKING_FORK - -/* Define to 1 if `vfork' works. */ -#undef HAVE_WORKING_VFORK - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define as `fork' if `vfork' does not work. */ -#undef vfork diff --git a/test/test-automation/configure.ac b/test/test-automation/configure.ac deleted file mode 100644 index bc24d941f..000000000 --- a/test/test-automation/configure.ac +++ /dev/null @@ -1,57 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.65]) -AC_INIT([runner], [0.01], [markus.kauppila@gmail.com]) -AC_CONFIG_SRCDIR([src/runner/runner.c]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR(acinclude) -AC_CONFIG_AUX_DIR(build-scripts) - -AM_INIT_AUTOMAKE - -#libdir="$(pwd)/tests" -#AC_SUBST([libdir]) - -# Checks for programs. -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_LIBTOOL -AM_PROG_CC_C_O - -# Checks for libraries. - -# Checks for header files. -AC_CHECK_HEADERS([stdlib.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. - -# without this debugging information will be stripped (at least on OS X) -CFLAGS="-g" - -# Checks for library functions. -AC_FUNC_FORK - -AC_CONFIG_FILES([Makefile - src/runner/Makefile - src/libSDLtest/Makefile - tests/testdummy/Makefile - tests/testrect/Makefile - tests/testplatform/Makefile - tests/testaudio/Makefile - tests/testsurface/Makefile - tests/testrwops/Makefile - tests/testvideo/Makefile - tests/testsyswm/Makefile - tests/testclipboard/Makefile - tests/testevents/Makefile - tests/testkeyboard/Makefile - tests/testrender/Makefile]) - -AC_OUTPUT - -echo "" -echo "========================================" -echo "" -echo "./configure ready!" -echo "you're ready to run: 'make && sudo make install'" diff --git a/test/test-automation/data/images/icon.bmp b/test/test-automation/data/images/icon.bmp deleted file mode 100644 index cc96356ac..000000000 Binary files a/test/test-automation/data/images/icon.bmp and /dev/null differ diff --git a/test/test-automation/include/SDL_test.h b/test/test-automation/include/SDL_test.h deleted file mode 100644 index 4f3b6f02e..000000000 --- a/test/test-automation/include/SDL_test.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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_TEST_H -#define _SDL_TEST_H - -#include "../src/runner/logger.h" - -#include "../src/libSDLtest/common/common.h" -#include "../src/libSDLtest/common/images.h" -#include "../src/libSDLtest/fuzzer/fuzzer.h" - -#define TEST_ENABLED 1 -#define TEST_DISABLED 0 - -//! Definitions of assert results -#define ASSERT_PASS 1 -#define ASSERT_FAILURE 0 - -//! Definition of all the possible test results -#define TEST_RESULT_PASS 0 -#define TEST_RESULT_FAILURE 1 -#define TEST_RESULT_NO_ASSERT 2 -#define TEST_RESULT_SKIPPED 3 -#define TEST_RESULT_KILLED 4 -#define TEST_RESULT_SETUP_FAILURE 5 - -//! Definitions for test requirements -#define TEST_REQUIRES_AUDIO 1 -//! Defines that the a test requires STDIO -#define TEST_REQUIRES_STDIO 1 - -/*! - * Holds information about a test case - */ -typedef struct TestCaseReference { - /*!< "Func2Stress" */ - char *name; - /*!< "This test beats the crap out of func2()" */ - char *description; - /*!< Set to TEST_ENABLED or TEST_DISABLED */ - int enabled; - /*!< Set to TEST_REQUIRES_OPENGL, TEST_REQUIRES_AUDIO, ... */ - long requirements; - /* - - - - - - -Test report - - - - - - -

Test Report

-
- Start time:
- - Total runtime: seconds.
- Harness parameters: - - - - - -
- Statistics:
-
- Executed test suites.
- Tests in total: (passed: , failed: ) -
-
- - - - -
-
- diff --git a/test/test-automation/src/libSDLtest/Makefile.am b/test/test-automation/src/libSDLtest/Makefile.am deleted file mode 100644 index 7fb71f75a..000000000 --- a/test/test-automation/src/libSDLtest/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -INCLUDE = -I../../include - -lib_LTLIBRARIES = libSDLtest.la -libSDLtest_la_SOURCES = SDL_test.c \ - logger_helpers.c \ - plain_logger.c \ - xml_logger.c xml.c \ - common/common.c \ - common/img_blit.c \ - common/img_blitblend.c \ - common/img_face.c \ - common/img_primitives.c \ - common/img_primitivesblend.c \ - fuzzer/utl_crc32.c \ - fuzzer/utl_md5.c \ - fuzzer/utl_random.c \ - fuzzer/fuzzer.c \ - ../runner/logger.h -libSDLtest_la_CLAGS = -fPIC -g -libSDLtest_la_LDFLAGS = `sdl-config --libs` - -libSDLtest: libSDLtest.la - echo "Test library compiled." diff --git a/test/test-automation/src/libSDLtest/SDL_test.c b/test/test-automation/src/libSDLtest/SDL_test.c deleted file mode 100644 index 0f59ad8a4..000000000 --- a/test/test-automation/src/libSDLtest/SDL_test.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 /* printf/fprintf */ -#include /* va_list */ -#include - -#include - -#include "fuzzer/fuzzer.h" - -#include "../runner/logger.h" - -#include "../../include/SDL_test.h" - - -/*! \brief return value of test case. Non-zero value means that the test failed */ -int _testReturnValue; - -/*! \brief counts the failed asserts */ -int _testAssertsFailed; - -/*! \brief counts the passed asserts */ -int _testAssertsPassed; - -/*! \brief is the execution done in-process? */ -SDL_bool canBailOut; - -void -_InitTestEnvironment(Uint64 execKey, SDL_bool inproc) -{ - InitFuzzer(execKey); - - canBailOut = inproc == 0; - - _testReturnValue = TEST_RESULT_PASS; - _testAssertsFailed = 0; - _testAssertsPassed = 0; -} - -int -_QuitTestEnvironment() -{ - AssertSummary(_testAssertsFailed + _testAssertsPassed, - _testAssertsFailed, _testAssertsPassed, time(0)); - - if(_testAssertsFailed == 0 && _testAssertsPassed == 0) { - _testReturnValue = TEST_RESULT_NO_ASSERT; - } - - if(GetInvocationCount() > 0) { - Log(time(0), "Fuzzer invocation count: %d", GetInvocationCount()); - } - - DeinitFuzzer(); - - return _testReturnValue; -} - -int -_CountFailedAsserts() { - return _testAssertsFailed; -} - -/*! - * Bail out from test case. For example, the function is used to bail out - * from a test case after a failed assert. - */ -void -_BailOut() -{ - if(!canBailOut) - return ; - - AssertSummary(_testAssertsFailed + _testAssertsPassed, - _testAssertsFailed, _testAssertsPassed, time(0)); - - if(GetInvocationCount() > 0) { - Log(time(0), "Fuzzer invocation count: %d", GetInvocationCount()); - } - - DeinitFuzzer(); - - exit(TEST_RESULT_FAILURE); // bail out from the test -} - -void -AssertEquals(int expected, int actual, char *message, ...) -{ - va_list args; - char buf[256]; - - va_start( args, message ); - memset(buf, 0, sizeof(buf)); - SDL_vsnprintf( buf, sizeof(buf), message, args ); - va_end( args ); - - if(expected != actual) { - AssertWithValues("AssertEquals", 0, buf, actual, expected, time(0)); - - _testReturnValue = TEST_RESULT_FAILURE; - _testAssertsFailed++; - - _BailOut(); - } else { - AssertWithValues("AssertEquals", 1, buf, - actual, expected, time(0)); - - _testAssertsPassed++; - } -} - - -void -AssertTrue(int condition, char *message, ...) -{ - va_list args; - char buf[256]; - va_start( args, message ); - SDL_vsnprintf( buf, sizeof(buf), message, args ); - va_end( args ); - - if (!condition) { - Assert("AssertTrue", 0, buf, time(0)); - - _testReturnValue = TEST_RESULT_FAILURE; - _testAssertsFailed++; - - _BailOut(); - } else { - Assert("AssertTrue", 1, buf, time(0)); - - _testAssertsPassed++; - } -} - -void -AssertPass(char *message, ...) -{ - va_list args; - char buf[256]; - - va_start( args, message ); - SDL_vsnprintf( buf, sizeof(buf), message, args ); - va_end( args ); - - Assert("AssertPass", 1, buf, time(0)); - - _testAssertsPassed++; -} - - -void -AssertFail(char *message, ...) -{ - va_list args; - char buf[256]; - - va_start( args, message ); - SDL_vsnprintf( buf, sizeof(buf), message, args ); - va_end( args ); - - Assert("AssertFail", 0, buf, time(0)); - - _testReturnValue = TEST_RESULT_FAILURE; - _testAssertsFailed++; - - _BailOut(); -} - diff --git a/test/test-automation/src/libSDLtest/common/common.c b/test/test-automation/src/libSDLtest/common/common.c deleted file mode 100644 index 1f202cdb9..000000000 --- a/test/test-automation/src/libSDLtest/common/common.c +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Automated SDL_Surface test. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#include "common.h" - -/** - * @brief Compares a surface and a surface image for equality - * - * @param sur Surface used in comparison - * @param img Surface image used in comparison - * @param allowable_error Allowable difference in blending accuracy - */ -int surface_compare( SDL_Surface *sur, const SurfaceImage_t *img, int allowable_error ) -{ - int ret; - int i,j; - int bpp; - Uint8 *p, *pd; - - /* Make sure size is the same. */ - if ((sur->w != img->width) || (sur->h != img->height)) - return -1; - - SDL_LockSurface( sur ); - - ret = 0; - bpp = sur->format->BytesPerPixel; - - /* Compare image - should be same format. */ - for (j=0; jh; j++) { - for (i=0; iw; i++) { - p = (Uint8 *)sur->pixels + j * sur->pitch + i * bpp; - pd = (Uint8 *)img->pixel_data + (j*img->width + i) * img->bytes_per_pixel; - switch (bpp) { - case 1: - case 2: - case 3: - ret += 1; - /*printf("%d BPP not supported yet.\n",bpp);*/ - break; - - case 4: - { - int dist = 0; - Uint8 R, G, B, A; - - SDL_GetRGBA(*(Uint32*)p, sur->format, &R, &G, &B, &A); - - if (img->bytes_per_pixel == 3) { - dist += (R-pd[0])*(R-pd[0]); - dist += (G-pd[1])*(G-pd[1]); - dist += (B-pd[2])*(B-pd[2]); - } else { - dist += (R-pd[0])*(R-pd[0]); - dist += (G-pd[1])*(G-pd[1]); - dist += (B-pd[2])*(B-pd[2]); - dist += (A-pd[3])*(A-pd[3]); - } - /* Allow some difference in blending accuracy */ - if (dist > allowable_error) { - /*printf("pixel %d,%d varies by %d\n", i, j, dist);*/ - ++ret; - } - } - break; - } - } - } - - SDL_UnlockSurface( sur ); - - if (ret) { - SDL_SaveBMP(sur, "fail.bmp"); - - SDL_LockSurface( sur ); - - bpp = sur->format->BytesPerPixel; - - if (bpp == 4) { - for (j=0; jh; j++) { - for (i=0; iw; i++) { - Uint8 R, G, B, A; - p = (Uint8 *)sur->pixels + j * sur->pitch + i * bpp; - pd = (Uint8 *)img->pixel_data + (j*img->width + i) * img->bytes_per_pixel; - - R = pd[0]; - G = pd[1]; - B = pd[2]; - if (img->bytes_per_pixel == 4) { - A = pd[3]; - } else { - A = 0; - } - *(Uint32*)p = (A << 24) | (R << 16) | (G << 8) | B; - } - } - } - - SDL_UnlockSurface( sur ); - - SDL_SaveBMP(sur, "good.bmp"); - } - return ret; -} diff --git a/test/test-automation/src/libSDLtest/common/common.h b/test/test-automation/src/libSDLtest/common/common.h deleted file mode 100644 index cf40f1feb..000000000 --- a/test/test-automation/src/libSDLtest/common/common.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Automated SDL test common framework. - * - * Written by Edgar Simo "bobbens" - * - * Released under Public Domain. - */ - - -#ifndef COMMON_H -# define COMMON_H - -#include "SDL/SDL.h" - -# define FORMAT SDL_PIXELFORMAT_ARGB8888 -# define AMASK 0xff000000 /**< Alpha bit mask. */ -# define RMASK 0x00ff0000 /**< Red bit mask. */ -# define GMASK 0x0000ff00 /**< Green bit mask. */ -# define BMASK 0x000000ff /**< Blue bit mask. */ - - -typedef struct SurfaceImage_s { - int width; - int height; - unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ - const unsigned char pixel_data[]; -} SurfaceImage_t; - -#define ALLOWABLE_ERROR_OPAQUE 0 -#define ALLOWABLE_ERROR_BLENDED 64 - -/** - * @brief Compares a surface and a surface image for equality. - * - * @param sur Surface to compare. - * @param img Image to compare against. - * @return 0 if they are the same, -1 on error and positive if different. - */ -int surface_compare( SDL_Surface *sur, const SurfaceImage_t *img, int allowable_error ); - - -#endif /* COMMON_H */ - diff --git a/test/test-automation/src/libSDLtest/common/images.h b/test/test-automation/src/libSDLtest/common/images.h deleted file mode 100644 index 4ee3a94fd..000000000 --- a/test/test-automation/src/libSDLtest/common/images.h +++ /dev/null @@ -1,22 +0,0 @@ - - -#ifndef IMAGES_H -# define IMAGES_H - - -#include "common.h" - - -/* - * Pull in images for testcases. - */ -#include "img_primitives.c" -#include "img_primitivesblend.c" -#include "img_face.c" -#include "img_blit.c" -#include "img_blitblend.c" - - -#endif /* IMAGES_H */ - - diff --git a/test/test-automation/src/libSDLtest/common/img_blit.c b/test/test-automation/src/libSDLtest/common/img_blit.c deleted file mode 100644 index 9ea57d6df..000000000 --- a/test/test-automation/src/libSDLtest/common/img_blit.c +++ /dev/null @@ -1,1456 +0,0 @@ -/* GIMP RGB C-Source image dump (blit.c) */ - -#include "common.h" - -static const SurfaceImage_t img_blit = { - 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", -}; -static const SurfaceImage_t img_blitColour = { - 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", -}; -static const SurfaceImage_t img_blitAlpha = { - 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", -}; - diff --git a/test/test-automation/src/libSDLtest/common/img_blitblend.c b/test/test-automation/src/libSDLtest/common/img_blitblend.c deleted file mode 100644 index d0be0867a..000000000 --- a/test/test-automation/src/libSDLtest/common/img_blitblend.c +++ /dev/null @@ -1,2691 +0,0 @@ -/* GIMP RGB C-Source image dump (alpha.c) */ -#include "common.h" - -static const SurfaceImage_t img_blendAdd = { - 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", -}; - -static const SurfaceImage_t img_blendBlend = { - 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", -}; - -static const SurfaceImage_t img_blendMod = { - 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", -}; - -static const SurfaceImage_t img_blendNone = { - 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", -}; - -static const SurfaceImage_t img_blendAll = { - 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", -}; - diff --git a/test/test-automation/src/libSDLtest/common/img_face.c b/test/test-automation/src/libSDLtest/common/img_face.c deleted file mode 100644 index 56e76345f..000000000 --- a/test/test-automation/src/libSDLtest/common/img_face.c +++ /dev/null @@ -1,197 +0,0 @@ -/* GIMP RGBA C-Source image dump (face.c) */ -#include "common.h" - -static const SurfaceImage_t img_face = { - 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", -}; - diff --git a/test/test-automation/src/libSDLtest/common/img_primitives.c b/test/test-automation/src/libSDLtest/common/img_primitives.c deleted file mode 100644 index 0db5b9265..000000000 --- a/test/test-automation/src/libSDLtest/common/img_primitives.c +++ /dev/null @@ -1,464 +0,0 @@ -/* GIMP RGB C-Source image dump (primitives.c) */ -#include "common.h" - -static const SurfaceImage_t img_primitives = { - 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", -}; - diff --git a/test/test-automation/src/libSDLtest/common/img_primitivesblend.c b/test/test-automation/src/libSDLtest/common/img_primitivesblend.c deleted file mode 100644 index a6f49b358..000000000 --- a/test/test-automation/src/libSDLtest/common/img_primitivesblend.c +++ /dev/null @@ -1,646 +0,0 @@ -/* GIMP RGB C-Source image dump (alpha.c) */ -#include "common.h" - -static const SurfaceImage_t img_blend = { - 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. -*/ - -#include -#include -#include - -#include "../../../include/SDL_test.h" - -#include "fuzzer.h" - -/*! - * Note: doxygen documentation markup is in the header file. - */ - -//! context for test-specific random number generator -static RND_CTX rndContext; - -//! Counts invocation of fuzzer generator functions -int invocationCounter = 0; - -Uint64 -GenerateExecKey(char *runSeed, char *suiteName, - char *testName, int iterationNumber) -{ - if(runSeed == NULL) { - fprintf(stderr, "Error: Incorrect runSeed given to GenerateExecKey function\n"); - return -1; - } - - if(suiteName == NULL) { - fprintf(stderr, "Error: Incorrect suiteName given to GenerateExecKey function\n"); - return -1; - } - - if(testName == NULL) { - fprintf(stderr, "Error: Incorrect testName given to GenerateExecKey function\n"); - return -1; - } - - if(iterationNumber < 0) { - fprintf(stderr, "Error: Incorrect iteration number given to GenerateExecKey function\n"); - return -1; - } - - char iterationString[16]; - memset(iterationString, 0, sizeof(iterationString)); - SDL_snprintf(iterationString, sizeof(iterationString) - 1, "%d", iterationNumber); - - // combine the parameters - const Uint32 runSeedLength = strlen(runSeed); - const Uint32 suiteNameLength = strlen(suiteName); - const Uint32 testNameLength = strlen(testName); - const Uint32 iterationStringLength = strlen(iterationString); - - // size of the entire + 3 for slashes and + 1 for '\0' - const Uint32 entireString = runSeedLength + suiteNameLength + - testNameLength + iterationStringLength + 3 + 1; - - char *buffer = SDL_malloc(entireString); - if(!buffer) { - return 0; - } - - SDL_snprintf(buffer, entireString, "%s/%s/%s/%d", runSeed, suiteName, - testName, iterationNumber); - - MD5_CTX md5Context; - utl_md5Init(&md5Context); - utl_md5Update(&md5Context, buffer, entireString); - utl_md5Final(&md5Context); - - SDL_free(buffer); - - Uint64 *keys = (Uint64 *)md5Context.digest; - - return keys[0]; -} - -void -InitFuzzer(Uint64 execKey) -{ - Uint32 a = (execKey >> 32) & 0x00000000FFFFFFFF; - Uint32 b = execKey & 0x00000000FFFFFFFF; - utl_randomInit(&rndContext, a, b); -} - -int -GetInvocationCount() -{ - return invocationCounter; -} - -void -DeinitFuzzer() -{ - invocationCounter = 0; -} - -Uint8 -RandomUint8() -{ - invocationCounter++; - - return (Uint8) utl_randomInt(&rndContext) & 0x000000FF; -} - -Sint8 -RandomSint8() -{ - invocationCounter++; - - return (Sint8) utl_randomInt(&rndContext) & 0x000000FF; -} - -Uint16 -RandomUint16() -{ - invocationCounter++; - - return (Uint16) utl_randomInt(&rndContext) & 0x0000FFFF; -} - -Sint16 -RandomSint16() -{ - invocationCounter++; - - return (Sint16) utl_randomInt(&rndContext) & 0x0000FFFF; -} - -Sint32 -RandomSint32() -{ - invocationCounter++; - - return (Sint32) utl_randomInt(&rndContext); -} - -Uint32 -RandomUint32() -{ - invocationCounter++; - - return (Uint32) utl_randomInt(&rndContext); -} - -Uint64 -RandomUint64() -{ - Uint64 value; - - invocationCounter++; - - Uint32 *vp = (Uint32*)&value; - vp[0] = RandomSint32(); - vp[1] = RandomSint32(); - - return value; -} - -Sint64 -RandomSint64() -{ - Uint64 value; - - invocationCounter++; - - Uint32 *vp = (Uint32*)&value; - vp[0] = RandomSint32(); - vp[1] = RandomSint32(); - - return value; -} - - - -Sint32 -RandomIntegerInRange(Sint32 pMin, Sint32 pMax) -{ - Sint64 min = pMin; - Sint64 max = pMax; - - if(pMin > pMax) { - Sint64 temp = min; - min = max; - max = temp; - } else if(pMin == pMax) { - return min; - } - - Sint64 number = RandomUint32(); // invocation count increment in there - - return (Sint32)((number % ((max + 1) - min)) + min); -} - -/*! - * Generates boundary values 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(sizeof(Uint8), 10, 20, True) -> [10,11,19,20] - * BoundaryValues(sizeof(Uint8), 10, 20, False) -> [9,21] - * BoundaryValues(sizeof(Uint8), 0, 15, True) -> [0, 1, 14, 15] - * BoundaryValues(sizeof(Uint8), 0, 15, False) -> [16] - * BoundaryValues(sizeof(Uint8), 0, 255, False) -> NULL - * - * Generator works the same for other types of unsigned integers. - * - * Note: outBuffer will be allocated and needs to be freed later. - * If outbuffer != NULL, it'll be freed. - * - * \param maxValue The biggest value that is acceptable for this data type. - * For instance, for Uint8 -> 255, Uint16 -> 65536 etc. - * \param pBoundary1 defines lower boundary - * \param pBoundary2 defines upper boundary - * \param validDomain Generate only for valid domain (for the data type) - * - * \param outBuffer The generated boundary values are put here - * - * \returns Returns the number of elements in outBuffer or -1 in case of error - */ -Uint32 -GenerateUnsignedBoundaryValues(const Uint64 maxValue, - Uint64 pBoundary1, Uint64 pBoundary2, SDL_bool validDomain, - Uint64 *outBuffer) -{ - Uint64 boundary1 = pBoundary1, boundary2 = pBoundary2; - - if(outBuffer != NULL) { - SDL_free(outBuffer); - } - - if(boundary1 > boundary2) { - Uint64 temp = boundary1; - boundary1 = boundary2; - boundary2 = temp; - } - - Uint64 tempBuf[4]; - Uint64 index = 0; - - if(boundary1 == boundary2) { - tempBuf[index++] = boundary1; - } - else if(validDomain) { - tempBuf[index++] = boundary1; - - if(boundary1 < UINT64_MAX) - tempBuf[index++] = boundary1 + 1; - - tempBuf[index++] = boundary2 - 1; - tempBuf[index++] = boundary2; - } - else { - if(boundary1 > 0) { - tempBuf[index++] = boundary1 - 1; - } - - if(boundary2 < maxValue && boundary2 < UINT64_MAX) { - tempBuf[index++] = boundary2 + 1; - } - } - - if(index == 0) { - // There are no valid boundaries - return 0; - } - - // Create the return buffer - outBuffer = SDL_malloc(index * sizeof(Uint64)); - if(outBuffer == NULL) { - return 0; - } - - SDL_memcpy(outBuffer, tempBuf, index * sizeof(Uint64)); - - return index; -} - -Uint8 -RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain) -{ - Uint64 *buffer = NULL; - Uint32 size; - - // max value for Uint8 - const Uint64 maxValue = UINT8_MAX; - - size = GenerateUnsignedBoundaryValues(maxValue, - (Uint64) boundary1, (Uint64) boundary2, - validDomain, buffer); - if(size == 0) { - return 0; - } - - Uint32 index = RandomSint32() % size; - Uint8 retVal = (Uint8) buffer[index]; - - SDL_free(buffer); - - invocationCounter++; - - return retVal; -} - -Uint16 -RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain) -{ - Uint64 *buffer = NULL; - Uint32 size; - - // max value for Uint16 - const Uint64 maxValue = UINT16_MAX; - - size = GenerateUnsignedBoundaryValues(maxValue, - (Uint64) boundary1, (Uint64) boundary2, - validDomain, buffer); - if(size == 0) { - return 0; - } - - Uint32 index = RandomSint32() % size; - Uint16 retVal = (Uint16) buffer[index]; - - SDL_free(buffer); - - invocationCounter++; - - return retVal; -} - -Uint32 -RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain) -{ - Uint64 *buffer = NULL; - Uint32 size; - - // max value for Uint32 - const Uint64 maxValue = UINT32_MAX; - - size = GenerateUnsignedBoundaryValues(maxValue, - (Uint64) boundary1, (Uint64) boundary2, - validDomain, buffer); - if(size == 0) { - return 0; - } - - Uint32 index = RandomSint32() % size; - Uint32 retVal = (Uint32) buffer[index]; - - SDL_free(buffer); - - invocationCounter++; - - return retVal; -} - -Uint64 -RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) -{ - Uint64 *buffer = NULL; - Uint32 size; - - // max value for Uint64 - const Uint64 maxValue = UINT64_MAX; - - size = GenerateUnsignedBoundaryValues(maxValue, - (Uint64) boundary1, (Uint64) boundary2, - validDomain, buffer); - if(size == 0) { - return 0; - } - - Uint32 index = RandomSint32() % size; - Uint64 retVal = (Uint64) buffer[index]; - - SDL_free(buffer); - - invocationCounter++; - - return retVal; -} - -/*! - * Generates boundary values 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(sizeof(Sint8), -10, 20, True) -> [-11,-10,19,20] - * SignedBoundaryValues(sizeof(Sint8), -10, 20, False) -> [-11,21] - * SignedBoundaryValues(sizeof(Sint8), -30, -15, True) -> [-30, -29, -16, -15] - * SignedBoundaryValues(sizeof(Sint8), -128, 15, False) -> [16] - * SignedBoundaryValues(sizeof(Sint8), -128, 127, False) -> NULL - * - * Generator works the same for other types of signed integers. - * - * Note: outBuffer will be allocated and needs to be freed later. - * If outbuffer != NULL, it'll be freed. - * - * - * \param minValue The smallest value that is acceptable for this data type. - * For instance, for Uint8 -> -128, Uint16 -> -32,768 etc. - * \param maxValue The biggest value that is acceptable for this data type. - * For instance, for Uint8 -> 127, Uint16 -> 32767 etc. - * \param pBoundary1 defines lower boundary - * \param pBoundary2 defines upper boundary - * \param validDomain Generate only for valid domain (for the data type) - * - * \param outBuffer The generated boundary values are put here - * - * \returns Returns the number of elements in outBuffer or -1 in case of error - */ -Uint32 -GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, - Sint64 pBoundary1, Sint64 pBoundary2, SDL_bool validDomain, - Sint64 *outBuffer) -{ - Sint64 boundary1 = pBoundary1, boundary2 = pBoundary2; - - if(outBuffer != NULL) { - SDL_free(outBuffer); - } - - if(boundary1 > boundary2) { - Sint64 temp = boundary1; - boundary1 = boundary2; - boundary2 = temp; - } - - Sint64 tempBuf[4]; - - Sint64 index = 0; - - if(boundary1 == boundary2) { - tempBuf[index++] = boundary1; - } - else if(validDomain) { - tempBuf[index++] = boundary1; - - if(boundary1 < LLONG_MAX) - tempBuf[index++] = boundary1 + 1; - - if(boundary2 > LLONG_MIN) - tempBuf[index++] = boundary2 - 1; - - tempBuf[index++] = boundary2; - } - else { - if(boundary1 > minValue && boundary1 > LLONG_MIN) { - tempBuf[index++] = boundary1 - 1; - } - - if(boundary2 < maxValue && boundary2 < UINT64_MAX) { - tempBuf[index++] = boundary2 + 1; - } - } - - if(index == 0) { - // There are no valid boundaries - return 0; - } - - // Create the return buffer - outBuffer = SDL_malloc(index * sizeof(Sint64)); - if(outBuffer == NULL) { - return 0; - } - - SDL_memcpy(outBuffer, tempBuf, index * sizeof(Sint64)); - - return index; -} - -Sint8 -RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain) -{ - Sint64 *buffer = NULL; - Uint32 size; - - // min & max values for Sint8 - const Sint64 maxValue = CHAR_MAX; - const Sint64 minValue = CHAR_MIN; - - size = GenerateSignedBoundaryValues(minValue, maxValue, - (Sint64) boundary1, (Sint64) boundary2, - validDomain, buffer); - if(size == 0) { - return CHAR_MIN; - } - - Uint32 index = RandomSint32() % size; - Sint8 retVal = (Sint8) buffer[index]; - - SDL_free(buffer); - - invocationCounter++; - - return retVal; -} - -Sint16 -RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain) -{ - Sint64 *buffer = NULL; - Uint32 size; - - // min & max values for Sint16 - const Sint64 maxValue = SHRT_MAX; - const Sint64 minValue = SHRT_MIN; - - size = GenerateSignedBoundaryValues(minValue, maxValue, - (Sint64) boundary1, (Sint64) boundary2, - validDomain, buffer); - if(size == 0) { - return SHRT_MIN; - } - - Uint32 index = RandomSint32() % size; - Sint16 retVal = (Sint16) buffer[index]; - - SDL_free(buffer); - - invocationCounter++; - - return retVal; -} - -Sint32 -RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain) -{ - Sint64 *buffer = NULL; - Uint32 size; - - // min & max values for Sint32 - const Sint64 maxValue = INT_MAX; - const Sint64 minValue = INT_MIN; - - size = GenerateSignedBoundaryValues(minValue, maxValue, - (Sint64) boundary1, (Sint64) boundary2, - validDomain, buffer); - if(size == 0) { - return INT_MIN; - } - - Uint32 index = RandomSint32() % size; - Sint32 retVal = (Sint32) buffer[index]; - - SDL_free(buffer); - - invocationCounter++; - - return retVal; -} - -Sint64 -RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain) -{ - Sint64 *buffer = NULL; - Uint32 size; - - // min & max values for Sint64 - const Sint64 maxValue = LLONG_MAX; - const Sint64 minValue = LLONG_MIN; - - size = GenerateSignedBoundaryValues(minValue, maxValue, - (Sint64) boundary1, (Sint64) boundary2, - validDomain, buffer); - if(size == 0) { - return LLONG_MIN; - } - - Uint32 index = RandomSint32() % size; - Sint64 retVal = (Sint64) buffer[index]; - - SDL_free(buffer); - - invocationCounter++; - - return retVal; -} - -float -RandomUnitFloat() -{ - return (float) RandomUint32() / UINT_MAX; -} - -double -RandomUnitDouble() -{ - return (RandomUint64() >> 11) * (1.0/9007199254740992.0); -} - -float -RandomFloat() -{ - invocationCounter++; - - // \todo to be implemented - return 0.0f; -} - -double -RandomDouble() -{ - invocationCounter++; - - // \todo to be implemented - return 0.0f; -} - - -char * -RandomAsciiString() -{ - // note: invocationCounter is increment in the RandomAsciiStringWithMaximumLenght - return RandomAsciiStringWithMaximumLength(255); -} - -char * -RandomAsciiStringWithMaximumLength(int maxSize) -{ - invocationCounter++; - - if(maxSize < 1) { - return NULL; - } - - int size = (RandomUint32() % (maxSize + 1)) + 1; - char *string = SDL_malloc(size * sizeof(char)); - - int counter = 0; - for( ; counter < size; ++counter) { - string[counter] = (char) RandomIntegerInRange(1, 127); - } - - string[counter] = '\0'; - - return string; -} diff --git a/test/test-automation/src/libSDLtest/fuzzer/fuzzer.h b/test/test-automation/src/libSDLtest/fuzzer/fuzzer.h deleted file mode 100644 index f090deb7c..000000000 --- a/test/test-automation/src/libSDLtest/fuzzer/fuzzer.h +++ /dev/null @@ -1,361 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 _FUZZER_H -#define _FUZZER_H - -#include - -#include "utl_crc32.h" -#include "utl_md5.h" -#include "utl_random.h" - -/*! - * \file - * Note: fuzzer implementation uses static instance of random context - * internally which makes it thread-UNsafe. - */ - -/*! - * Inits the fuzzer for a test - */ -void InitFuzzer(Uint64 execKey); - - -/*! - * Deinits the fuzzer (for a test) - */ -void DeinitFuzzer(); - - -/*! - * Returns a random Uint8 - * - * \returns Generated integer - */ -Uint8 RandomUint8(); - -/*! - * Returns a random Sint8 - * - * \returns Generated signed integer - */ -Sint8 RandomSint8(); - - -/*! - * Returns a random Uint16 - * - * \returns Generated integer - */ -Uint16 RandomUint16(); - -/*! - * Returns a random Sint16 - * - * \returns Generated signed integer - */ -Sint16 RandomSint16(); - - -/*! - * Returns a random integer - * - * \returns Generated integer - */ -Sint32 RandomSint32(); - - -/*! - * Returns a random positive integer - * - * \returns Generated integer - */ -Uint32 RandomUint32(); - -/*! - * Returns random Uint64. - * - * \returns Generated integer - */ -Uint64 RandomUint64(); - - -/*! - * Returns random Sint64. - * - * \returns Generated signed integer - */ -Sint64 RandomSint64(); - -/*! - * Returns random float in range [0.0 - 1.0] (inclusive) - */ -float RandomUnitFloat(); - -/*! - * Returns random double in range [0.0 - 1.0[ (note: zero included, 1 is not!) - */ -double RandomUnitDouble(); - -/*! - * Returns random float. - * - * Note: NOT implemented. - */ -float RandomFloat(); - -/*! - * Returns random double - * - * Note: NOT implemented. - */ -double 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 -1 (== error value) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid or not? - * - * \returns Boundary value in given range or error value (-1) - */ -Uint8 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 -1 (== error value) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid or not? - * - * \returns Boundary value in given range or error value (-1) - */ -Uint16 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 -1 (== error value) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid or not? - * - * \returns Boundary value in given range or error value (-1) - */ -Uint32 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 -1 (== error value) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid or not? - * - * \returns Boundary value in given range or error value (-1) - */ -Uint64 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(-128, 99, SDL_FALSE) returns 100 - * RandomSint8BoundaryValue(-128, 127, SDL_FALSE) returns SINT8_MIN (== error value) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid or not? - * - * \returns Boundary value in given range or error value (-1) - */ -Sint8 -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(SINT8_MIN, 99, SDL_FALSE) returns 100 - * RandomSint16BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT16_MIN (== error value) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid or not? - * - * \returns Boundary value in given range or error value (-1) - */ -Sint16 -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 or not? - * - * \returns Boundary value in given range or error value (-1) - */ -Sint32 -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, SINT32_MAX, SDL_FALSE) returns SINT64_MIN (== error value) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid or not? - * - * \returns Boundary value in given range or error value (-1) - */ -Sint64 -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. - * - * \returns Generated integer - */ -Sint32 RandomIntegerInRange(Sint32 min, Sint32 max); - - -/*! - * Generates random null-terminated string. The maximum length for - * the string is 255 characters and it can contain ASCII characters - * from 1 to 127. - * - * Note: Returned string needs to be deallocated. - * - * \returns newly allocated random string - */ -char *RandomAsciiString(); - - -/*! - * Generates random null-terminated string. The maximum length for - * the string is defined by maxLenght parameter. - * String can contain ASCII characters from 1 to 127. - * - * Note: Returned string needs to be deallocated. - * - * \param maxLength Maximum length of the generated string - * - * \returns newly allocated random string - */ -char *RandomAsciiStringWithMaximumLength(int maxLength); - - -/*! - * Generates execution key (used for random seed) for a test - * - * \param runSeed Seed of the harness - * \param suiteName Test suite name - * \param testName Test name - * \param iterationNumber of test iteration - * - * \return Generated execution key as blob of 16 bytes. It needs be deallocated. - * On error, returns NULL. - */ -Uint64 GenerateExecKey(char *runSeed, char *suiteName, char *testName, int iterationNumber); - -/*! - * Returns test specific invocation count for the fuzzer. - */ -int GetInvocationCount(); - -#endif diff --git a/test/test-automation/src/libSDLtest/fuzzer/utl_crc32.c b/test/test-automation/src/libSDLtest/fuzzer/utl_crc32.c deleted file mode 100644 index eb7903041..000000000 --- a/test/test-automation/src/libSDLtest/fuzzer/utl_crc32.c +++ /dev/null @@ -1,125 +0,0 @@ - -#include "utl_crc32.h" - -int utl_crc32Init(CRC32_CTX *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 utl_crc32Calc(CRC32_CTX * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) -{ - if (utl_crc32CalcStart(crcContext,crc32)) { - return(-1); - } - if (utl_crc32CalcBuffer(crcContext, inBuf, inLen, crc32)) { - return(-1); - } - if (utl_crc32CalcEnd(crcContext, crc32)) { - return(-1); - } - return(0); -} - -/* Start crc calculation */ - -int utl_crc32CalcStart(CRC32_CTX * 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 utl_crc32CalcEnd(CRC32_CTX * crcContext, CrcUint32 *crc32) -{ - /* - * Return complement, per CRC-32 spec - */ - *crc32 = (~(*crc32)); - - return(0); -} - -/* Include memory block in crc */ - -int utl_crc32CalcBuffer(CRC32_CTX * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) -{ - CrcUint8 *p; - register CrcUint32 crc; - - /* Sanity check pointers */ - if (crcContext==NULL) { - *crc32=0; - 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 utl_crc32Done(CRC32_CTX * crcContext) -{ - /* Sanity check context pointer */ - if (crcContext==NULL) { - return(-1); - } - - return(0); -} diff --git a/test/test-automation/src/libSDLtest/fuzzer/utl_crc32.h b/test/test-automation/src/libSDLtest/fuzzer/utl_crc32.h deleted file mode 100644 index dbbcb47ce..000000000 --- a/test/test-automation/src/libSDLtest/fuzzer/utl_crc32.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef _utl_crc32_h -#define _utl_crc32_h - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------- Includes -------------- */ - -#include - -/* ------------ 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 */ - } CRC32_CTX; - -/* ---------- Function Prototypes ------------- */ - -#ifdef WIN32 -#ifdef BUILD_DLL -#define DLLINTERFACE __declspec(dllexport) -#else -#define DLLINTERFACE __declspec(dllimport) -#endif -#else -#define DLLINTERFACE -#endif - -/* - * utl_crc32Init: initialize the CRC context - * - * Parameters: - * - * crcContext pointer to context variable - * - * Return value: - * - * 0 OK - * -1 error - * - * Note: The function initializes the crc table required for crc calcs. - */ - DLLINTERFACE int utl_crc32Init(CRC32_CTX * crcContext); - - -/* - * utl_crc32Calc: calculate a crc32 from a data block - * - * Parameters: - * - * crcContext pointer to context variable - * inBuf input buffer to checksum - * inLen length of input buffer - * crc32 pointer to Uint32 to store the final CRC into - * - * Return value: - * - * 0 OK - * -1 error - * -*/ - - DLLINTERFACE int utl_crc32Calc(CRC32_CTX * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); - -/* Same routine broken down into three steps */ - - DLLINTERFACE int utl_crc32CalcStart(CRC32_CTX * crcContext, CrcUint32 *crc32); - DLLINTERFACE int utl_crc32CalcEnd(CRC32_CTX * crcContext, CrcUint32 *crc32); - DLLINTERFACE int utl_crc32CalcBuffer(CRC32_CTX * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); - - -/* - * utl_crc32Done: clean up CRC context - * - * Parameters: - * - * crcContext pointer to context variable - * - * Return value: - * - * 0 OK - * -1 error - * -*/ - - DLLINTERFACE int utl_crc32Done(CRC32_CTX * crcContext); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -}; -#endif - -#endif /* _utl_crc32_h */ diff --git a/test/test-automation/src/libSDLtest/fuzzer/utl_md5.c b/test/test-automation/src/libSDLtest/fuzzer/utl_md5.c deleted file mode 100644 index 626297bcf..000000000 --- a/test/test-automation/src/libSDLtest/fuzzer/utl_md5.c +++ /dev/null @@ -1,314 +0,0 @@ - -/* - *********************************************************************** - ** 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. ** - *********************************************************************** - */ - -#include "utl_md5.h" - -/* forward declaration */ -static void Transform(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 utl_md5Init(MD5_CTX * mdContext) -{ - 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 utl_md5Update(MD5_CTX * mdContext, unsigned char *inBuf, - unsigned int inLen) -{ - MD5UINT4 in[16]; - int mdi; - unsigned int i, ii; - - /* - * 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]); - Transform(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 utl_md5Final(MD5_CTX * mdContext) -{ - MD5UINT4 in[16]; - int mdi; - unsigned int i, ii; - unsigned int padLen; - - /* - * 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); - utl_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]); - Transform(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 Transform(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; -} - -/* - *********************************************************************** - ** End of utl_md5.c ** - ******************************** (cut) ******************************** - */ diff --git a/test/test-automation/src/libSDLtest/fuzzer/utl_md5.h b/test/test-automation/src/libSDLtest/fuzzer/utl_md5.h deleted file mode 100644 index e812b4992..000000000 --- a/test/test-automation/src/libSDLtest/fuzzer/utl_md5.h +++ /dev/null @@ -1,125 +0,0 @@ - -/* - *********************************************************************** - ** utl_md5.h -- 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 _utl_md5_h -#define _utl_md5_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 */ - } MD5_CTX; - -/* ---------- Function Prototypes ------------- */ - -#ifdef WIN32 -#ifdef BUILD_DLL -#define DLLINTERFACE __declspec(dllexport) -#else -#define DLLINTERFACE __declspec(dllimport) -#endif -#else -#define DLLINTERFACE -#endif - -/* - * utl_md5Init: initialize the context - * - * Parameters: - * - * mdContext pointer to context variable - * - * Return value: - * - * none - * - * Note: The function initializes the message-digest context - * mdContext. Call before each new use of the context - - * all fields are set to zero. - */ - DLLINTERFACE void utl_md5Init(MD5_CTX * mdContext); - - -/* - * utl_md5update: update digest from variable length data - * - * Parameters: - * - * mdContext pointer to context variable - * inBuf pointer to data array/string - * inLen length of data array/string - * - * Return value: - * - * none - * - * 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. -*/ - - DLLINTERFACE void utl_md5Update(MD5_CTX * mdContext, unsigned char *inBuf, - unsigned int inLen); - - -/* - * utl_md5Final: complete digest computation - * - * Parameters: - * - * mdContext pointer to context variable - * - * Return value: - * - * none - * - * 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. -*/ - - DLLINTERFACE void utl_md5Final(MD5_CTX * mdContext); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -}; -#endif - -#endif /* _utl_md5_h */ diff --git a/test/test-automation/src/libSDLtest/fuzzer/utl_random.c b/test/test-automation/src/libSDLtest/fuzzer/utl_random.c deleted file mode 100644 index 9290afe47..000000000 --- a/test/test-automation/src/libSDLtest/fuzzer/utl_random.c +++ /dev/null @@ -1,63 +0,0 @@ - -/* - - utl_random - - A "32-bit Multiply with carry" random number generator. - -*/ - - -#include "utl_random.h" - - -/* Initialize random number generator with two integer variables */ - -void utl_randomInit(RND_CTX * rndContext, unsigned int xi, unsigned int ci) -{ - /* - * 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 time */ - -void utl_randomInitTime(RND_CTX * rndContext) -{ - int a,b; - - srand(time(NULL)); - a=rand(); - srand(clock()); - b=rand(); - utl_randomInit(rndContext, a, b); -} - -/* Returns random numbers */ - -unsigned int utl_random(RND_CTX * rndContext) -{ - unsigned int xh, xl; - - 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/test/test-automation/src/libSDLtest/fuzzer/utl_random.h b/test/test-automation/src/libSDLtest/fuzzer/utl_random.h deleted file mode 100644 index 7fcaa71bf..000000000 --- a/test/test-automation/src/libSDLtest/fuzzer/utl_random.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - - A "32-bit Multiply with carry: random number generator. - Has a list of recommended multipliers. Very fast and good. - - multiply-with-carry generator" x(n) = a*x(n-1) + carry mod 2^32. - period" (a*2^31)-1 - -*/ - -#ifndef _utl_random_h -#define _utl_random_h - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* ------- Includes ---------- */ - -#include -#include -#include - -/* ------- Definitions ------- */ - -/* - * Macros that return random number in a specific format. See utl_random() - * below for details. Float values are in the range [0.0-1.0]. - */ -#define utl_randomInt(c) ((int)utl_random(c)) -#define utl_randomFloat(c) ((double)utl_random(c)/(unsigned long)0xffffffff) - - typedef struct { - unsigned int a; - unsigned int x; - unsigned int c; - unsigned int ah; - unsigned int al; - } RND_CTX; - -/* ---- Function Prototypes -------- */ - -#ifdef WIN32 -#ifdef BUILD_DLL -#define DLLINTERFACE __declspec(dllexport) -#else -#define DLLINTERFACE __declspec(dllimport) -#endif -#else -#define DLLINTERFACE -#endif - -/* - * utl_randomInit: Initialize random number generator with two integers. - * - * Paramaters: - * - * rndContext pointer to context structure - * xi, ci integers that define the random sequence - * - * Return value: - * - * none - * - * Note: The random sequence of numbers returned by utl_random() is the - * same for the same two integers and has a period of 2^31. - * - */ - DLLINTERFACE void utl_randomInit(RND_CTX * rndContext, unsigned int xi, - unsigned int ci); - -/* - * utl_randomInitTime: Initialize random number generator with the time - * - * Parameters: - * - * rndContext pointer to context structure - * - * Return value: - * - * none - * - */ - DLLINTERFACE void utl_randomInitTime(RND_CTX * rndContext); - - -/* - * utl_random: Returns random numbers - * - * Parameters: - * - * rndContext pointer to context structure - * - * Return value: - * - * random number (32bit unsigned integer) - * - * Note: utl_randomInit() or utl_randomInitTime() must have been called - * before using this function. - * - */ - DLLINTERFACE unsigned int utl_random(RND_CTX * rndContext); - - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -}; -#endif - -#endif /* _utl_random_h */ diff --git a/test/test-automation/src/libSDLtest/logger_helpers.c b/test/test-automation/src/libSDLtest/logger_helpers.c deleted file mode 100644 index f8b55513b..000000000 --- a/test/test-automation/src/libSDLtest/logger_helpers.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 "logger_helpers.h" - -/*! - * Helper function. Turns the given integer in to a string - * - * Note: uses 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 integer The converted integer - * \returns Given integer as string - */ -char *IntToString(const int integer) { - static char buffer[256]; // malloc might work better - memset(buffer, 0, sizeof(buffer)); - - SDL_snprintf(buffer, sizeof(buffer), "%d", integer); - - return buffer; -} - -/*! - * Helper function. Turns the given integer in to a string in - * hex format. - * - * Note: uses 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 integer The converted integer - * \returns Given integer as string in hex fomat - */ -char *IntToHexString(const Uint64 integer) { - static char buffer[256]; // malloc might work better - memset(buffer, 0, sizeof(buffer)); - - SDL_snprintf(buffer, sizeof(buffer), "%llX", integer); - - return buffer; -} - -/*! - * Helper function. Turns the given double value in to a string - * - * Note: uses 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 decimal The converted double value - * \returns Given double value as string - */ -char *DoubleToString(const double decimal) { - static char buffer[256]; // malloc might work better - memset(buffer, 0, sizeof(buffer)); - - SDL_snprintf(buffer, sizeof(buffer), "%.5f", decimal); - - return buffer; -} - -/*! - * Converts unix timestamp to its ascii presentation - * - * Note: uses 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 Timestamp - * \return Ascii presentation - */ -char *TimestampToString(const time_t timestamp) { - static char buffer[256]; - memset(buffer, 0, sizeof(buffer)); - - time_t copy = timestamp; - - struct tm *local = localtime(©); - strftime(buffer, sizeof(buffer), "%a %Y-%m-%d %H:%M:%S %Z", local); - - return buffer; -} - -/*! - * Converts unix timestamp to its ascii presentation in given format - * - * Note: uses 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 Timestamp - * \param format Formatting specification such as "%Y%m%d" - * - * \return Ascii presentation - */ -char *TimestampToStringWithFormat(const time_t timestamp, char *format) { - static char buffer[256]; - memset(buffer, 0, sizeof(buffer)); - - time_t copy = timestamp; - - struct tm *local = localtime(©); - strftime(buffer, sizeof(buffer), format, local); - - return buffer; -} - -/*! Turns all the characters of the given - * string to lowercase and returns the resulting string. - * - * \param string String to be converted - * \return Newly allocated lower-case version of the given string - */ -char * -ToLowerCase(const char *string) -{ - if(ValidateString(string) == 0) { - return NULL; - } - - const int size = SDL_strlen(string); - char *ret = SDL_malloc(size + 1); - strncpy(ret, string, size); - ret[size] = '\0'; - - int counter = 0; - for(; counter < size; ++counter) { - ret[counter] = tolower(ret[counter]); - } - - // printf("Debug: %s == %s\n", string, ret); - - return ret; -} - -/*! - * Validates string by checking that given string is not - * NULL, its length is non-zero etc. - * - * \param string Validated string - * \returns 1 if string is valid, otherwise 0 - */ -int -ValidateString(const char *string) -{ - int retVal = 1; - - if(string != NULL) { - if(SDL_strlen(string) > 0) { - retVal = 1; - } - - retVal = 1; - } else { - retVal = 0; - } - - return retVal; -} - - diff --git a/test/test-automation/src/libSDLtest/plain_logger.c b/test/test-automation/src/libSDLtest/plain_logger.c deleted file mode 100644 index f570cf84d..000000000 --- a/test/test-automation/src/libSDLtest/plain_logger.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 _PLAIN_LOGGER -#define _PLAIN_LOGGER - -#include "stdio.h" - -#include "../../include/SDL_test.h" - -#include "../runner/logger.h" - -#include "logger_helpers.h" -#include "plain_logger.h" - -/*! Current indentationt level */ -static int indentLevel; - -/*! Logging level of the logger */ -static Level level = LOGGER_TERSE; - -//! Handle to log file -static FILE *logFile; - -/*! - * Prints out the output of the logger - * - * \param currentIndentLevel The currently used indentation level - * \param message The message to be printed out - */ -int -Output(const int currentIndentLevel, const char *message, ...) -{ - if(logFile == NULL) { - fprintf(stderr, "logfile is NULL\n"); - exit(3); - } - - int indent = 0; - for( ; indent < currentIndentLevel; ++indent) { - fprintf(logFile, " "); // \todo make configurable? - } - - char buffer[1024]; - memset(buffer, 0, 1024); - - va_list list; - va_start(list, message); - - SDL_vsnprintf(buffer, 1024, message, list); - - va_end(list); - fprintf(logFile, "%s\n", buffer); - fflush(logFile); -} - - -void -PlainRunStarted(int parameterCount, char *runnerParameters[], char *runSeed, - time_t eventTime, LoggerData *data) -{ - if(data == NULL) { - fprintf(stderr, "Logger data is NULL\n"); - exit(3); - } - - // Set up the logging destination - if(data->stdoutEnabled == 1) { - logFile = stdout; - } else { - logFile = fopen(data->filename, "w"); - if(logFile == NULL) { - fprintf(stderr, "Log file %s couldn't opened\n", data->filename); - exit(3); - } - } - - - level = data->level; - - Output(indentLevel, "Test run started at %s", TimestampToString(eventTime)); - Output(indentLevel, "Fuzzer seed is: %s", runSeed); - Output(indentLevel, "Runner parameters: "); - - int counter = 0; - for(counter = 0; counter < parameterCount; counter++) { - char *parameter = runnerParameters[counter]; - Output(indentLevel, "\t%s", parameter); - } - - Output(indentLevel, ""); -} - -void -PlainRunEnded(int testCount, int suiteCount, int testPassCount, int testFailCount, - int testSkippedCount, time_t endTime, double totalRuntime) -{ - Output(indentLevel, "Test run ended at %s", TimestampToString(endTime)); - - Output(indentLevel, "Ran %d tests in %0.5f seconds from %d suites.", - testCount, totalRuntime, suiteCount); - - Output(indentLevel, "%d tests passed", testPassCount); - Output(indentLevel, "%d tests failed", testFailCount); - Output(indentLevel, "%d tests skipped", testSkippedCount); - - fclose(logFile); -} - -void -PlainSuiteStarted(const char *suiteName, time_t eventTime) -{ - Output(indentLevel++, "Executing tests from %s", suiteName); -} - -void -PlainSuiteEnded(int testsPassed, int testsFailed, int testsSkipped, - time_t endTime, double totalRuntime) -{ - Output(--indentLevel, "Suite executed. %d passed, %d failed and %d skipped. Total runtime %0.5f seconds", - testsPassed, testsFailed, testsSkipped, totalRuntime); - Output(indentLevel, ""); -} - -void -PlainTestStarted(const char *testName, const char *suiteName, - const char *testDescription, Uint64 execKey, time_t startTime) -{ - Output(indentLevel, "Executing test: %s (in %s, exec key: %llX)", testName, suiteName, execKey); - Output(indentLevel++, "Test description: %s", testDescription); -} - -void -PlainTestEnded(const char *testName, const char *suiteName, - int testResult, time_t endTime, double totalRuntime) -{ - switch(testResult) { - case TEST_RESULT_PASS: - Output(--indentLevel, "%s: ok", testName); - break; - case TEST_RESULT_FAILURE: - Output(--indentLevel, "%s: failed", testName); - break; - case TEST_RESULT_NO_ASSERT: - Output(--indentLevel, "%s: failed -> no assert", testName); - break; - case TEST_RESULT_SKIPPED: - Output(--indentLevel, "%s: skipped", testName); - break; - case TEST_RESULT_KILLED: - Output(--indentLevel, "%s: killed, exceeded timeout", testName); - break; - case TEST_RESULT_SETUP_FAILURE: - Output(--indentLevel, "%s: killed, setup failure", testName); - break; - } -} - -void -PlainAssert(const char *assertName, int assertResult, const char *assertMessage, - time_t eventTime) -{ - // Log passed asserts only on VERBOSE level - if(level <= LOGGER_TERSE && assertResult == ASSERT_PASS) { - return ; - } - - const char *result = (assertResult) ? "passed" : "failed"; - Output(indentLevel, "%s: %s - %s", assertName, result, assertMessage); -} - -void -PlainAssertWithValues(const char *assertName, int assertResult, const char *assertMessage, - int actualValue, int expectedValue, time_t eventTime) -{ - // Log passed asserts only on VERBOSE level - if(level <= LOGGER_TERSE && assertResult == ASSERT_PASS) { - return ; - } - - const char *result = (assertResult) ? "passed" : "failed"; - Output(indentLevel, "%s: %s (expected %d, actualValue %d) - %s", - assertName, result, expectedValue, actualValue, assertMessage); -} - -void -PlainAssertSummary(int numAsserts, int numAssertsFailed, int numAssertsPass, time_t eventTime) -{ - Output(indentLevel, "Assert summary: %d failed, %d passed (total: %d)", - numAssertsFailed, numAssertsPass, numAsserts); -} - -void -PlainLog(time_t eventTime, char *fmt, ...) -{ - // create the log message - va_list args; - char logMessage[1024]; - memset(logMessage, 0, sizeof(logMessage)); - - va_start( args, fmt ); - SDL_vsnprintf( logMessage, sizeof(logMessage), fmt, args ); - va_end( args ); - - Output(indentLevel, "%s", logMessage); -} - -#endif diff --git a/test/test-automation/src/libSDLtest/plain_logger.h b/test/test-automation/src/libSDLtest/plain_logger.h deleted file mode 100644 index a0e1d6198..000000000 --- a/test/test-automation/src/libSDLtest/plain_logger.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 _PLAIN_LOGGER_H -#define _PLAIN_LOGGER_H - -#include -#include "../runner/logger.h" - - -/*! - * Prints out information about starting the test run. - * - * \param parameterCount How many parameters were given - * \param runnerParameters What parameters were given to the runner - * \param runSeed Fuzzer seed of the harness - * \param eventTime When the execution started - * \param data LoggerData structure which contains data for the logger - * - */ -void PlainRunStarted(int parameterCount, char *runnerParameters[], char *runSeed, - time_t eventTime, LoggerData *data); - -/*! - * Prints out information about ending the test run. - * - * \param testCount How many tests were executed in total - * \param suiteCount How many suite were executed in total - * \param testPassCount How many tests passed in total - * \param testSkippedCount How many tests were skipped in total - * \param testFailCount How many tests failed in total - * \param endTime When the execution ended - * \param totalRuntime How long the execution took - */ -void PlainRunEnded(int testCount, int suiteCount, int testPassCount, int testFailCount, - int testSkippedCount, time_t endTime, double totalRuntime); - -/*! - * Prints the data about the test suite that'll be executed next - * - * \param suiteName Name of the test suite - * \param eventTime When the execution starts - */ -void PlainSuiteStarted(const char *suiteName, time_t eventTime); - -/*! - * Prints information about the test suite that was just executed - * - * \param testsPassed how many tests passed from this suite - * \param testsFailed how many tests failed from this suite - * \param testsSkipped how many tests were skipped (not implemented) - * \param endTime When the suite execution ended - * \param totalRuntime How long did the suite's execution take - */ -void PlainSuiteEnded(int testsPassed, int testsFailed, int testsSkipped, - time_t endTime, double totalRuntime); - -/*! - * Prints the data about the test test that'll be executed next - * - * \param testName Name of the test that'll be executed - * \param suiteName Name of the suite of the test - * \param testDescription Description of the test - * \param execKey Execution key for fuzzing - * \param startTime When the test started to execute - */ -void PlainTestStarted(const char *testName, const char *suiteName, - const char *testDescription, Uint64 execKey, time_t startTime); - -/*! - * Prints information about the test test that was just executed - * - * \param testName Name of the executed test - * \param suiteName Name of the suite of the test - * \param testResult Did the test fail (!= 0) or pass (== 0) - * \param endTime When the test execution ended - * \param totalRuntime Total runtime of the executed test - */ -void PlainTestEnded(const char *testName, const char *suiteName, - int testResult, time_t endTime, double totalRuntime); - - -/*! - * Prints information about plain assert - * - * \param assertName Name of the assert - * \param assertResult Did assert fail (== 0) or success (!= 0) - * \param assertMessage Message of the assert - * \param eventTime When the assert happened - */ -void PlainAssert(const char *assertName, int assertResult, const char *assertMessage, - time_t eventTime); - -/*! - * Prints information about assert that has actual and expected values - * - * \param assertName Name of the assert - * \param assertResult Did assert fail (== 0) or success (!= 0) - * \param assertMessage Message of the assert - * \param actualValue Actual value of assert - * \param expected Excepted value of assert - * \param eventTime When the assert happened - */ -void PlainAssertWithValues(const char *assertName, int assertResult, const char *assertMessage, - int actualValue, int expected, time_t eventTime); - -/*! - * Prints summary of all assertions of certain tests - * - * \param numAsserts Total assert count for the executed test - * \param numAssertsFailed Count of failed asserts in the test - * \param numAssertsPass Count of passed asserts in the test - * \param eventTime Timestamp of the summary - */ -void PlainAssertSummary(int numAsserts, int numAssertsFailed, int numAssertsPass, time_t eventTime); - -/*! - * Prints given message - * - * \param eventTime Timestamp for log message - * \param fmt Message to be logged - */ -void PlainLog(time_t eventTime, char *fmt, ...); - -#endif diff --git a/test/test-automation/src/libSDLtest/xml.c b/test/test-automation/src/libSDLtest/xml.c deleted file mode 100644 index db7528d2d..000000000 --- a/test/test-automation/src/libSDLtest/xml.c +++ /dev/null @@ -1,376 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 "xml.h" -#include "logger_helpers.h" - -/*! Size for xml element buffer */ -#define bufferSize 1024 -/*! Buffer for storing the xml element under construction */ -static char buffer[bufferSize]; - -/*! Pointer to XML root element's tag */ -static const char *root; - -/*! - * Defines structure used for "counting" open XML-tags - */ -typedef struct TagList { - const char *tag; - struct TagList *next; -} TagList; - -static TagList *openTags = NULL; - -/*! - * Prepend the open tags list - * - * \return On error returns non-zero value, otherwise zero will returned - */ -static int -AddOpenTag(const char *tag) -{ - TagList *openTag = SDL_malloc(sizeof(TagList)); - if(openTag == NULL) { - return 1; - } - memset(openTag, 0, sizeof(TagList)); - - const int tagSize = SDL_strlen(tag) + 1; - openTag->tag = SDL_malloc(tagSize); - if(openTag->tag == NULL) { - SDL_free(openTag); - return 1; - } - - strncpy((char *)openTag->tag, (char *)tag, tagSize); - - openTag->next = openTags; - - openTags = openTag; - - return 0; -} - -/*! - * Removes the first tag from the open tag list - * - * \return On error returns non-zero value, otherwise zero will returned - */ -static int -RemoveOpenTag(const char *tag) -{ - if(openTags == NULL || ValidateString(tag) == 0) { - return 1; - } - - int retVal = 0; - - const int size = SDL_strlen(tag); - char *tempTag = SDL_malloc(size); - strncpy(tempTag, tag, size); - - // Tag should always be the same as previously opened tag - // It prevents opening and ending tag mismatch - if(SDL_strncmp(tempTag, tag, size) == 0) { - TagList *openTag = openTags; - SDL_free((char *)openTag->tag); - - openTags = openTags->next; - SDL_free(openTag); - } else { - //printf("Debug | xml.c:RemoveOpenTag(): open/end tag mismatch"); - retVal = 1; - } - - return retVal; -} - -/*! - * Debug function. Prints the contents of the open tags list. - */ -static void -PrintOpenTags() -{ - printf("\nOpen tags:\n"); - - TagList *openTag = NULL; - for(openTag = openTags; openTag; openTag = openTag->next) { - printf("\ttag: %s\n", openTag->tag); - } -} - - -/*! - * Converts the special characters ', ", <, >, and & to - * corresponding entities: ' " < > and & - * - * \param string String to be escaped - * \return Newly allocated escaped string - */ -const char * -EscapeString(const char *string) -{ - // Calculate the size of the escaped string - int totalSize = 0; - - const int maxCount = SDL_strlen(string); - - int counter = 0; - for(; counter < maxCount; ++counter) { - char character = string[counter]; - - switch(character) { - case '&': totalSize += 5; //SDL_strlen("&"); - break; - case '\'': totalSize += 6; //SDL_strlen("'"); - break; - case '"': totalSize += 6; //SDL_strlen("""); - break; - case '<': totalSize += 4; //SDL_strlen("<"); - break; - case '>': totalSize += 4; //SDL_strlen(">"); - break; - default: - totalSize += 1; - break; - } - } - totalSize += 1; // for '\0' - - char *retBuffer = SDL_malloc(totalSize * sizeof(char)); - if(retBuffer == NULL) { - return NULL; - } - - // escape the string - char *curRetBuffer = retBuffer; - const char *curString = string; - - char character = *curString; - while( (character = *curString++) ) { - - switch(character) { - case '&': - memcpy((void *)curRetBuffer, (void *)"&", 5); - curRetBuffer += 5; - break; - case '\'': - memcpy((void *)curRetBuffer, (void *)"'", 6); - curRetBuffer += 6; - break; - case '"': - memcpy((void *)curRetBuffer, (void *)""", 6); - curRetBuffer += 6; - break; - case '<': - memcpy((void *)curRetBuffer, (void *)"<", 4); - curRetBuffer += 4; - break; - case '>': - memcpy((void *)curRetBuffer, (void *)">", 4); - curRetBuffer += 4; - break; - default: - *curRetBuffer = character; - curRetBuffer += 1; - break; - } - } - - *curRetBuffer = '\0'; - - return retBuffer; -} - - -/* -=================== - - Functions to handle creation of XML elements - -=================== -*/ - -char * -XMLOpenDocument(const char *rootTag, const char *xslStyle) -{ - const char *doctype = "\n"; - - //! \todo refactor this mess - char *style = NULL; - if(xslStyle) { - const char *styleStart = "\n"; - - const int sizeStyleStart = SDL_strlen(styleStart); - const int sizeStyleEnd = SDL_strlen(styleEnd); - const int sizeStyleSheetName = SDL_strlen(xslStyle); - - const int tempSize = sizeStyleStart + sizeStyleEnd + sizeStyleSheetName + 1; - style = SDL_malloc(tempSize); - memset(style, 0, tempSize); - SDL_snprintf(style, tempSize, "%s%s%s", styleStart, xslStyle, styleEnd); - } - - memset(buffer, 0, bufferSize); - SDL_snprintf(buffer, bufferSize, "<%s>", rootTag); - - AddOpenTag(rootTag); - - root = rootTag; // it's fine, as long as rootTag points to static memory? - - char *retBuf = NULL; - if(xslStyle) { - const int doctypeSize = SDL_strlen(doctype); - const int styleSize = SDL_strlen(style); - const int tagSize = SDL_strlen(buffer); - - const int size = doctypeSize + styleSize + tagSize + 1; // extra byte for '\0' - retBuf = SDL_malloc(size); - - SDL_snprintf(retBuf, size, "%s%s%s", doctype, style, buffer); - - SDL_free(style); - } else { - const int doctypeSize = SDL_strlen(doctype); - const int tagSize = SDL_strlen(buffer); - - const int size = doctypeSize + tagSize + 1; // extra byte for '\0' - retBuf = SDL_malloc(size); - - SDL_snprintf(retBuf, size, "%s%s", doctype, buffer); - } - - return retBuf; -} - -char * -XMLCloseDocument() { - return XMLCloseElement(root); -} - -char * -XMLOpenElement(const char *tag) -{ - memset(buffer, 0, bufferSize); - SDL_snprintf(buffer, bufferSize, "<%s>", tag); - - AddOpenTag(tag); - - const int size = SDL_strlen(buffer); - char *ret = SDL_malloc(size + 1); - strncpy(ret, buffer, size); - ret[size] = '\0'; - - return ret; -} - -char * -XMLAddContent(const char *content) -{ - if(ValidateString(content) == 0) { - return NULL; - } - - const char *escapedContent = EscapeString(content); - - if(SDL_strlen(escapedContent) >= bufferSize) { - return NULL; - } - - memset(buffer, 0, bufferSize); - SDL_snprintf(buffer, bufferSize, "%s", escapedContent); - SDL_free((char *)escapedContent); - - const int size = SDL_strlen(buffer); - char *ret = SDL_malloc(size + 1); - strncpy(ret, buffer, size); - ret[size] = '\0'; - - return ret; -} - -char * -XMLCloseElement(const char *tag) -{ - if(ValidateString(tag) == 0) { - return NULL; - } - - int retBufferSize = 150; - char *ret = SDL_malloc(retBufferSize); - memset(ret, 0, retBufferSize); - - // \todo check that element we're trying to close is actually open, - // otherwise it'll cause nesting problems - - // Close the open tags with proper nesting. Closes tags until it finds - // the given tag which is the last tag that will be closed - TagList *openTag = openTags; - while(openTag) { - TagList *temp = openTag->next; - - char *lowOpenTag = ToLowerCase(openTag->tag); - char *lowTag = ToLowerCase(tag); - - const int openTagSize = SDL_strlen(lowOpenTag); - const int tagSize = SDL_strlen(lowTag); - const int compSize = (openTagSize > tagSize) ? openTagSize : tagSize; - - memset(buffer, 0, bufferSize); - - int breakOut = 0; - if(SDL_strncmp(lowOpenTag, lowTag, compSize) == 0) { - breakOut = 1; - SDL_snprintf(buffer, bufferSize, "", tag); - } else { - SDL_snprintf(buffer, bufferSize, "", openTag->tag); - } - - SDL_free(lowOpenTag); - SDL_free(lowTag); - - int bytesLeft = bufferSize - SDL_strlen(ret); - if(bytesLeft) { - strncat(ret, buffer, bytesLeft); - } else { - // \! todo there's probably better way to report an error? - fprintf(stderr, "xml.c | XMLCloseElement: Buffer is full"); - } - - RemoveOpenTag(openTag->tag); - - openTag = temp; - - if(breakOut) { - break; - } - } - - return ret; -} - diff --git a/test/test-automation/src/libSDLtest/xml.h b/test/test-automation/src/libSDLtest/xml.h deleted file mode 100644 index 98d02f866..000000000 --- a/test/test-automation/src/libSDLtest/xml.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 _XML_H -#define _XML_H - -/*! Defines attribute for XML elements */ -typedef struct Attribute { - const char *attribute; - const char *value; -} Attribute; - - -/*! - * Opens XML document. - * Creates header and start tag for root element. - * - * Note: XML creation is not thread-safe! - * - * \param rootTag Root tag for the XML document - * \param xslStyle Name of the style sheet file. (empty string if no style is used) - * \return The generated XML output - */ -char *XMLOpenDocument(const char *rootTag, const char *xslStyle); - -/*! - * Closes the XML-document. - * Creates end tag for root element and closes other open elements - * with correct nesting. - */ -char *XMLCloseDocument(); - -/*! - * Opens XML-element. - * - * \param tag Element to be opened - */ -char *XMLOpenElement(const char *tag); - -/*! - * Add content to currently open element. - * - * \param content Content for the currently open element - */ -char *XMLAddContent(const char *content); - -/*! - * Closes previously opened element until tag given as parameter is met. - * Enforces proper nesting by not allowing to close elements out-of-order. - * - * Closes all the opened elements until the given element/tag is found - * which will be the last tag to be closed - * - * \param tag Element to close - */ -char *XMLCloseElement(const char *tag); - -#endif - diff --git a/test/test-automation/src/libSDLtest/xml_logger.c b/test/test-automation/src/libSDLtest/xml_logger.c deleted file mode 100644 index 93e51678c..000000000 --- a/test/test-automation/src/libSDLtest/xml_logger.c +++ /dev/null @@ -1,674 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 "../../include/SDL_test.h" - -#include "../runner/logger.h" - -#include "xml.h" -#include "logger_helpers.h" -#include "xml_logger.h" - -/*! Static strings for XML elements */ -const char *documentRoot = "testlog"; -const char *parametersElementName = "parameters"; -const char *parameterElementName = "parameter"; -const char *startTimeElementName = "startTime"; -const char *seedElementName = "seed"; -const char *execKeyElementName = "executionKey"; -const char *numSuitesElementName = "numSuites"; -const char *numTestElementName = "numTests"; -const char *numPassedTestsElementName = "numPassedTests"; -const char *numFailedTestsElementName = "numFailedTests"; -const char *numSkippedTestsElementName = "numSkippedTests"; -const char *endTimeElementName = "endTime"; -const char *totalRuntimeElementName = "totalRuntime"; -const char *suiteElementName = "suite"; -const char *testsPassedElementName = "testsPassed"; -const char *testsFailedElementName = "testsFailed"; -const char *testsSkippedElementName = "testsSkipped"; -const char *testElementName = "test"; -const char *nameElementName = "name"; -const char *descriptionElementName = "description"; -const char *resultElementName = "result"; -const char *resultDescriptionElementName = "resultDescription"; -const char *assertElementName = "assert"; -const char *messageElementName = "message"; -const char *timeElementName = "time"; -const char *assertSummaryElementName = "assertSummary"; -const char *assertCountElementName = "assertCount"; -const char *assertsPassedElementName = "assertsPassed"; -const char *assertsFailedElementName = "assertsFailed"; -const char *logElementName = "log"; - - -/*! Current indentationt level */ -static int indentLevel; - -/*! Logging level of the logger */ -static Level level = LOGGER_TERSE; - -//! Constants for XMLOuputters EOL parameter -#define YES 1 -#define NO 0 - -/*! Controls printing the indentation in relation to line breaks */ -static int prevEOL = YES; - -//! Handle to log file -static FILE *logFile = NULL; - -/* - * Prints out the given xml element etc. - * - * \todo Make the destination of the output changeable (defaults to stdout) - * - * \param currentIndentLevel the indent level of the message - * \param EOL will it print end of line character or not - * \param the XML element itself - * - */ -void -XMLOutputter(const int currentIndentLevel, - int EOL, const char *message) -{ - if(ValidateString(message)) { - int indent = 0; - for( ; indent < currentIndentLevel && prevEOL; ++indent) { - fprintf(logFile, " "); // \todo make configurable? - } - - prevEOL = EOL; - - if(EOL) { - fprintf(logFile, "%s\n", message); - } else { - fprintf(logFile, "%s", message); - } - - fflush(logFile); - } else { - fprintf(logFile, "Error: Tried to output invalid string!"); - } - - SDL_free((char *)message); -} - -void -XMLRunStarted(int parameterCount, char *runnerParameters[], char *runSeed, - time_t eventTime, LoggerData *data) -{ - // Set up the logging destination - if(data->stdoutEnabled) { - logFile = stdout; - } else { - logFile = fopen(data->filename, "w"); - if(logFile == NULL) { - fprintf(stderr, "Log file %s couldn't opened\n", data->filename); - exit(3); - } - } - - // Set up the style sheet - char *xslStylesheet = (char *)data->custom; - level = data->level; - //printf("Debug: %d == %d\n", level, data->level); - - char *output = XMLOpenDocument(documentRoot, xslStylesheet); - XMLOutputter(indentLevel++, YES, output); - - // log harness parameters - output = XMLOpenElement(parametersElementName); - XMLOutputter(indentLevel++, YES, output); - - int counter = 0; - for(counter = 0; counter < parameterCount; counter++) { - char *parameter = runnerParameters[counter]; - - output = XMLOpenElement(parameterElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(parameter); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(parameterElementName); - XMLOutputter(--indentLevel, YES, output); - } - - output = XMLCloseElement(parametersElementName); - XMLOutputter(--indentLevel, YES, output); - - // log seed - output = XMLOpenElement(seedElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(runSeed); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(seedElementName); - XMLOutputter(--indentLevel, YES, output); - - // log start time - output = XMLOpenElement(startTimeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(TimestampToString(eventTime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(startTimeElementName); - XMLOutputter(--indentLevel, YES, output); -} - -void -XMLRunEnded(int testCount, int suiteCount, int testPassCount, int testFailCount, - int testSkippedCount, time_t endTime, double totalRuntime) -{ - // log suite count - char *output = XMLOpenElement(numSuitesElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(suiteCount)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(numSuitesElementName); - XMLOutputter(--indentLevel, YES, output); - - // log test count - output = XMLOpenElement(numTestElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(testCount)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(numTestElementName); - XMLOutputter(--indentLevel, YES, output); - - // log passed test count - output = XMLOpenElement(numPassedTestsElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(testPassCount)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(numPassedTestsElementName); - XMLOutputter(--indentLevel, YES, output); - - // log failed test count - output = XMLOpenElement(numFailedTestsElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(testFailCount)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(numFailedTestsElementName); - XMLOutputter(--indentLevel, YES, output); - - // log skipped test count - output = XMLOpenElement(numSkippedTestsElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(testSkippedCount)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(numSkippedTestsElementName); - XMLOutputter(--indentLevel, YES, output); - - // log end tite - output = XMLOpenElement(endTimeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(TimestampToString(endTime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(endTimeElementName); - XMLOutputter(--indentLevel, YES, output); - - // log total runtime - output = XMLOpenElement(totalRuntimeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(DoubleToString(totalRuntime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(totalRuntimeElementName); - XMLOutputter(--indentLevel, YES, output); - - output = XMLCloseDocument(documentRoot); - XMLOutputter(--indentLevel, YES, output); - - // close the log file - fclose(logFile); -} - -void -XMLSuiteStarted(const char *suiteName, time_t eventTime) -{ - // log suite name - char *output = XMLOpenElement(suiteElementName); - XMLOutputter(indentLevel++, YES, output); - - output = XMLOpenElement(nameElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(suiteName); - XMLOutputter(indentLevel, NO, output); - - // log test name - output = XMLCloseElement(nameElementName); - XMLOutputter(--indentLevel, YES, output); - - output = XMLOpenElement(startTimeElementName); - XMLOutputter(indentLevel++, NO, output); - - // log beginning time - output = XMLAddContent(TimestampToString(eventTime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(startTimeElementName); - XMLOutputter(--indentLevel, YES, output); -} - -void -XMLSuiteEnded(int testsPassed, int testsFailed, int testsSkipped, - time_t endTime, double totalRuntime) -{ - // log tests passed - char *output = XMLOpenElement(testsPassedElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(testsPassed)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(testsPassedElementName); - XMLOutputter(--indentLevel, YES, output); - - // log tests failed - output = XMLOpenElement(testsFailedElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(testsFailed)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(testsFailedElementName); - XMLOutputter(--indentLevel, YES, output); - - // log tests skipped - output = XMLOpenElement(testsSkippedElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(testsSkipped)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(testsSkippedElementName); - XMLOutputter(--indentLevel, YES, output); - - // log tests skipped - output = XMLOpenElement(endTimeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(TimestampToString(endTime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(endTimeElementName); - XMLOutputter(--indentLevel, YES, output); - - // log total runtime - output = XMLOpenElement(totalRuntimeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(DoubleToString(totalRuntime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(totalRuntimeElementName); - XMLOutputter(--indentLevel, YES, output); - - - output = XMLCloseElement(suiteElementName); - XMLOutputter(--indentLevel, YES, output); -} - -void -XMLTestStarted(const char *testName, const char *suiteName, - const char *testDescription, Uint64 execKey, time_t startTime) -{ - char * output = XMLOpenElement(testElementName); - XMLOutputter(indentLevel++, YES, output); - - // log test name - output = XMLOpenElement(nameElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(testName); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(nameElementName); - XMLOutputter(--indentLevel, YES, output); - - // log test description - output = XMLOpenElement(descriptionElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(testDescription); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(descriptionElementName); - XMLOutputter(--indentLevel, YES, output); - - // log execution key - output = XMLOpenElement(execKeyElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToHexString(execKey)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(execKeyElementName); - XMLOutputter(--indentLevel, YES, output); - - // log start time - output = XMLOpenElement(startTimeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(TimestampToString(startTime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(startTimeElementName); - XMLOutputter(--indentLevel, YES, output); -} - -void -XMLTestEnded(const char *testName, const char *suiteName, - int testResult, time_t endTime, double totalRuntime) -{ - // Log test result - char *output = XMLOpenElement(resultElementName); - XMLOutputter(indentLevel++, NO, output); - - switch(testResult) { - case TEST_RESULT_PASS: - output = XMLAddContent("passed"); - break; - case TEST_RESULT_FAILURE: - output = XMLAddContent("failed"); - break; - case TEST_RESULT_NO_ASSERT: - output = XMLAddContent("failed"); - break; - case TEST_RESULT_SKIPPED: - output = XMLAddContent("skipped"); - break; - case TEST_RESULT_KILLED: - output = XMLAddContent("failed"); - break; - case TEST_RESULT_SETUP_FAILURE: - output = XMLAddContent("failed"); - break; - } - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(resultElementName); - XMLOutputter(--indentLevel, YES, output); - - // Log description of test result. Why the test failed, - // if there's some specific reason - output = XMLOpenElement(resultDescriptionElementName); - XMLOutputter(indentLevel++, NO, output); - - switch(testResult) { - case TEST_RESULT_PASS: - case TEST_RESULT_FAILURE: - case TEST_RESULT_SKIPPED: - output = XMLAddContent(""); - break; - case TEST_RESULT_NO_ASSERT: - output = XMLAddContent("No assert"); - break; - case TEST_RESULT_KILLED: - output = XMLAddContent("Timeout exceeded"); - break; - case TEST_RESULT_SETUP_FAILURE: - output = XMLAddContent("Setup failure, couldn't be executed"); - break; - } - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(resultDescriptionElementName); - XMLOutputter(--indentLevel, YES, output); - - // log total runtime - output = XMLOpenElement(endTimeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(TimestampToString(endTime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(endTimeElementName); - XMLOutputter(--indentLevel, YES, output); - - // log total runtime - output = XMLOpenElement(totalRuntimeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(DoubleToString(totalRuntime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(totalRuntimeElementName); - XMLOutputter(--indentLevel, YES, output); - - output = XMLCloseElement(testElementName); - XMLOutputter(--indentLevel, YES, output); -} - -void -XMLAssert(const char *assertName, int assertResult, const char *assertMessage, - time_t eventTime) -{ - // Log passed asserts only on VERBOSE level - if(level <= LOGGER_TERSE && assertResult == ASSERT_PASS) { - return ; - } - - char *output = XMLOpenElement(assertElementName); - XMLOutputter(indentLevel++, YES, output); - - // log assert name - output = XMLOpenElement(nameElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(assertName); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(nameElementName); - XMLOutputter(--indentLevel, YES, output); - - - // log assert result - output = XMLOpenElement(resultElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent((assertResult) ? "pass" : "failure"); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(resultElementName); - XMLOutputter(--indentLevel, YES, output); - - // log assert message - output = XMLOpenElement(messageElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(assertMessage); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(messageElementName); - XMLOutputter(--indentLevel, YES, output); - - // log event time - output = XMLOpenElement(timeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(TimestampToString(eventTime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(timeElementName); - XMLOutputter(--indentLevel, YES, output); - - output = XMLCloseElement(assertElementName); - XMLOutputter(--indentLevel, YES, output); -} - -void -XMLAssertWithValues(const char *assertName, int assertResult, const char *assertMessage, - int actualValue, int excpected, time_t eventTime) -{ - // Log passed asserts only on VERBOSE level - if(level <= LOGGER_TERSE && assertResult == ASSERT_PASS) { - return ; - } - - char *output = XMLOpenElement(assertElementName); - XMLOutputter(indentLevel++, YES, output); - - // log assert name - output = XMLOpenElement(nameElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(assertName); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(nameElementName); - XMLOutputter(--indentLevel, YES, output); - - - // log assert result - output = XMLOpenElement(resultElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent((assertResult) ? "pass" : "failure"); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(resultElementName); - XMLOutputter(--indentLevel, YES, output); - - // log assert message - output = XMLOpenElement(messageElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(assertMessage); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(messageElementName); - XMLOutputter(--indentLevel, YES, output); - - // log event time - output = XMLOpenElement(timeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(TimestampToString(eventTime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(timeElementName); - XMLOutputter(--indentLevel, YES, output); - - output = XMLCloseElement(assertElementName); - XMLOutputter(--indentLevel, YES, output); -} - -void -XMLAssertSummary(int numAsserts, int numAssertsFailed, - int numAssertsPass, time_t eventTime) -{ - char *output = XMLOpenElement(assertSummaryElementName); - XMLOutputter(indentLevel++, YES, output); - - output = XMLOpenElement(assertCountElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(numAsserts)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(assertCountElementName); - XMLOutputter(--indentLevel, YES, output); - - output = XMLOpenElement(assertsPassedElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(numAssertsPass)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(assertsPassedElementName); - XMLOutputter(--indentLevel, YES, output); - - output = XMLOpenElement(assertsFailedElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(IntToString(numAsserts)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(assertsFailedElementName); - XMLOutputter(--indentLevel, YES, output); - - output = XMLCloseElement(assertSummaryElementName); - XMLOutputter(--indentLevel, YES, output); -} - -void -XMLLog(time_t eventTime, char *fmt, ...) -{ - // create the log message - va_list args; - char logMessage[1024]; - memset(logMessage, 0, sizeof(logMessage)); - - va_start( args, fmt ); - SDL_vsnprintf( logMessage, sizeof(logMessage), fmt, args ); - va_end( args ); - - char *output = XMLOpenElement(logElementName); - XMLOutputter(indentLevel++, YES, output); - - // log message - output = XMLOpenElement(messageElementName); - XMLOutputter(indentLevel++, NO, output); - - // fix this here! - output = XMLAddContent(logMessage); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(messageElementName); - XMLOutputter(--indentLevel, YES, output); - - // log eventTime - output = XMLOpenElement(timeElementName); - XMLOutputter(indentLevel++, NO, output); - - output = XMLAddContent(TimestampToString(eventTime)); - XMLOutputter(indentLevel, NO, output); - - output = XMLCloseElement(timeElementName); - XMLOutputter(--indentLevel, YES, output); - - output = XMLCloseElement(logElementName); - XMLOutputter(--indentLevel, YES, output); -} diff --git a/test/test-automation/src/libSDLtest/xml_logger.h b/test/test-automation/src/libSDLtest/xml_logger.h deleted file mode 100644 index 7ca6f58c9..000000000 --- a/test/test-automation/src/libSDLtest/xml_logger.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 _XML_LOGGER_H -#define _XML_LOGGER_H - -#include - -#include "../runner/logger.h" - -/*! - * Prints out information about starting the test run in XML - * - * \param parameterCount How many parameters were given - * \param runnerParameters What parameters were given to the runner - * \param runSeed Fuzzer seed of the harness - * \param eventTime When the execution started - * \param data LoggerData structure which contains data for the logger - */ -void XMLRunStarted(int parameterCount, char *runnerParameters[], char *runSeed, - time_t eventTime, LoggerData *data); - -/*! - * Prints out information about ending the test run in XML - * - * \param testCount How many tests were executed in total - * \param suiteCount How many suite were executed in total - * \param testPassCount How many tests passed in total - * \param testFailCount How many tests failed in total - * \param testSkippedCount How many tests were skipped in total - * \param endTime When the execution ended - * \param totalRuntime How long the execution took - */ -void XMLRunEnded(int testCount, int suiteCount, int testPassCount, int testFailCount, - int testSkippedCount, time_t endTime, double totalRuntime); - -/*! - * Prints the data about the test suite that'll be executed next in XML - * - * \param suiteName Name of the test suite - * \param eventTime When the execution starts - */ -void XMLSuiteStarted(const char *suiteName, time_t eventTime); - -/*! - * Prints information about the test suite that was just executed in XML - * - * \param testsPassed how many tests passed from this suite - * \param testsFailed how many tests failed from this suite - * \param testsSkipped how many tests were skipped (not implemented) - * \param endTime When the suite execution ended - * \param totalRuntime How long did the suite's execution take - */ -void XMLSuiteEnded(int testsPassed, int testsFailed, int testsSkipped, - time_t endTime, double totalRuntime); - -/*! - * Prints the data about the test test that'll be executed next in XML - * - * \param testName Name of the test that'll be executed - * \param suiteName Name of the suite of the test - * \param testDescription Description of the test - * \param execKey Execution key for fuzzing - * \param startTime When the test started to execute - */ -void XMLTestStarted(const char *testName, const char *suiteName, - const char *testDescription, Uint64 execKey, time_t startTime); - -/*! - * Prints information about the test test that was just executed in XML - * - * \param testName Name of the executed test - * \param suiteName Name of the suite of the test - * \param testResult Did the test fail (!= 0) or pass (== 0) - * \param endTime When the test execution ended - * \param totalRuntime Total runtime of the executed test - */ -void XMLTestEnded(const char *testName, const char *suiteName, - int testResult, time_t endTime, double totalRuntime); - -/*! - * Prints information about plain assert in XML - * - * \param assertName Name of the assert - * \param assertResult Did assert fail (== 0) or success (!= 0) - * \param assertMessage Message of the assert - * \param eventTime When the assert happened - */ -void XMLAssert(const char *assertName, int assertResult, const char *assertMessage, - time_t eventTime); - -/*! - * Prints information about assert that has actual and expected values in XML - * - * \param assertName Name of the assert - * \param assertResult Did assert fail (== 0) or success (!= 0) - * \param assertMessage Message of the assert - * \param actualValue Actual value of assert - * \param expected Excepted value of assert - * \param eventTime When the assert happened - */ -void XMLAssertWithValues(const char *assertName, int assertResult, const char *assertMessage, - int actualValue, int expected, time_t eventTime); - -/*! - * Prints summary of all assertions of certain tests in XML - * - * \param numAsserts Total assert count for the executed test - * \param numAssertsFailed Count of failed asserts in the test - * \param numAssertsPass Count of passed asserts in the test - * \param eventTime Timestamp of the summary - */ -void XMLAssertSummary(int numAsserts, int numAssertsFailed, int numAssertsPass, time_t eventTime); - -/*! - * Prints given message in XML - * - * \param eventTime Timestamp for log message - * \param fmt Message to be logged - */ -void XMLLog(time_t eventTime, char *fmt, ...); - -#endif diff --git a/test/test-automation/src/runner/Makefile.am b/test/test-automation/src/runner/Makefile.am deleted file mode 100644 index f9e14ab37..000000000 --- a/test/test-automation/src/runner/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -INCLUDE = -I../libSDLtest -I../../include - -bin_PROGRAMS = runner -runner_SOURCES = runner.c support.c -runner_LDADD = ../libSDLtest/libSDLtest.la -runner_CFLAGS = -W -Wall -Wextra -g `sdl-config --cflags` -DSDL_NO_COMPAT -runner_LDFLAGS = `sdl-config --libs` diff --git a/test/test-automation/src/runner/logger.h b/test/test-automation/src/runner/logger.h deleted file mode 100644 index d4225e020..000000000 --- a/test/test-automation/src/runner/logger.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 _LOGGER_H -#define _LOGGER_H - -#include -#include - -/* Logging levels */ -typedef enum LogLevel { - LOGGER_TERSE = 1, - LOGGER_VERBOSE -} Level; - -//! Default logging level -#define LOGGER_DEFAULT_LEVEL LOGGER_TERSE - -//! Contains information for the logger -typedef struct LoggerData { - //! If enabled logger will write to stdout instead of file - int stdoutEnabled; - //!< Name and directory of the log file (ie. logs/runner-seed.log) - char *filename; - //!< Logging level of the logger (such as VERBOSE) - Level level; - //!< Some custom data that a logger needs - char *custom; -} LoggerData; - -/*! - * Typedefs for function pointers that implement the generic - * logging interface. See the headers of implementations (plain_logger.h or - * xml_logger.h) for more information. - */ -typedef void (*RunStartedFp)(int parameterCount, char *runnerParameters[], char *runSeed, time_t eventTime, LoggerData *data); -typedef void (*RunEndedFp)(int testCount, int suiteCount, int testPassCount, int testFailCount, - int testSkippedCount, time_t endTime, double totalRuntime); - -typedef void (*SuiteStartedFp)(const char *suiteName, time_t eventTime); -typedef void (*SuiteEndedFp)(int testsPassed, int testsFailed, int testsSkipped, - time_t endTime, double totalRuntime); - -typedef void (*TestStartedFp)(const char *testName, const char *suiteName, - const char *testDescription, Uint64 execKey, time_t startTime); -typedef void (*TestEndedFp)(const char *testName, const char *suiteName, int testResult, - time_t endTime, double totalRuntime); - -typedef void (*AssertFp)(const char *assertName, int assertResult, - const char *assertMessage, time_t eventTime); - -typedef void (*AssertWithValuesFp)(const char *assertName, int assertResult, - const char *assertMessage, int actualValue, int expected, - time_t eventTime); - -typedef void (*AssertSummaryFp)(int numAsserts, int numAssertsFailed, - int numAssertsPass, time_t eventTime); - -typedef void (*LogFp)(time_t eventTime, char *fmt, ...); - - -/*! Function pointers to actual logging function implementations */ -extern RunStartedFp RunStarted; -extern RunEndedFp RunEnded; -extern SuiteStartedFp SuiteStarted; -extern SuiteEndedFp SuiteEnded; -extern TestStartedFp TestStarted; -extern TestEndedFp TestEnded; -extern AssertFp Assert; -extern AssertWithValuesFp AssertWithValues; -extern AssertSummaryFp AssertSummary; -extern LogFp Log; - -#endif diff --git a/test/test-automation/src/runner/runner.c b/test/test-automation/src/runner/runner.c deleted file mode 100644 index 3303aa919..000000000 --- a/test/test-automation/src/runner/runner.c +++ /dev/null @@ -1,1506 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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/SDL.h" - -#include -#include -#include -#include -#include - -#include -#include - -#include "../../include/SDL_test.h" -#include "../../config.h" - -#include "../libSDLtest/fuzzer/fuzzer.h" - -#include "../libSDLtest/plain_logger.h" -#include "../libSDLtest/xml_logger.h" -#include "../libSDLtest/logger_helpers.h" - -#include "logger.h" -#include "support.h" - -//!< Function pointer to a test case function -typedef void (*TestCaseFp)(void *arg); -//!< Function pointer to a test case init function -typedef void (*InitTestInvironmentFp)(Uint64, SDL_bool); -//!< Function pointer to a test case quit function -typedef int (*QuitTestInvironmentFp)(void); -//!< Function pointer to a test case set up function -typedef void (*TestCaseSetUpFp)(void *arg); -//!< Function pointer to a test case tear down function -typedef void (*TestCaseTearDownFp)(void *arg); -//!< Function pointer to a function which returns the failed assert count -typedef int (*CountFailedAssertsFp)(void); - - -//!< Flag for executing tests in-process -static int execute_inproc = 0; - -//!< Flag for only printing out the test names -static int only_print_tests = 0; - -//!< Flag for executing only test with selected name -static int only_selected_test = 0; - -//!< Flag for executing only the selected test suite -static int only_selected_suite = 0; - -//!< Flag for executing only tests that contain certain string in their name -static int only_tests_with_string = 0; - -//!< Flag for enabling XML logging -static int xml_enabled = 0; - -//! Flag for enabling user-supplied style sheet for XML test report -static int custom_xsl_enabled = 0; - -//! Flag for disabling xsl-style from xml report -static int xsl_enabled = 0; - -//! Flag for enabling universal timeout for tests -static int universal_timeout_enabled = 0; - -//! Flag for enabling verbose logging -static int enable_verbose_logger = 0; - -//! Flag for using user supplied run seed -static int userRunSeed = 0; - -//! Whether or not logger should log to stdout instead of file -static int log_stdout_enabled = 1; - -//! Whether or not dummy suite should be included to the test run -static int include_dummy_suite = 0; - -//!< Size of the test and suite name buffers -#define NAME_BUFFER_SIZE 1024 - -//!< Name of the selected test -char selected_test_name[NAME_BUFFER_SIZE]; - -//!< Name of the selected suite -char selected_suite_name[NAME_BUFFER_SIZE]; - -//!< substring of test case name -char testcase_name_substring[NAME_BUFFER_SIZE]; - -//! Name for user-supplied XSL style sheet name -char xsl_stylesheet_name[NAME_BUFFER_SIZE]; - -//! User-suppled timeout value for tests -int universal_timeout = -1; - -//! Default directory of the test suites -#define DEFAULT_TEST_DIRECTORY "tests/" - -//! Default directory for placing log files -#define DEFAULT_LOG_DIRECTORY "logs" - -//! Default directory of the test suites -#define DEFAULT_LOG_FILENAME "testrun" - -//! Defines directory separator -#define DIRECTORY_SEPARATOR '/' - -#define DUMMY_TEST_NAME "libtestdummy" - -//! Name of the default stylesheet -const char *defaultXSLStylesheet = "style.xsl"; - -//! Fuzzer seed for the harness -char *runSeed = NULL; - -//! Execution key that user supplied via command options -Uint64 userExecKey = 0; - -//! How man time a test will be invocated -int testInvocationCount = 1; - -//! Stores the basename for log files -char log_basename[NAME_BUFFER_SIZE]; - -//! Stores directory name for placing the logs -char log_directory[NAME_BUFFER_SIZE]; - -// \todo add comments -int totalTestFailureCount = 0, totalTestPassCount = 0, totalTestSkipCount = 0; -int testFailureCount = 0, testPassCount = 0, testSkipCount = 0; - - -/*! - * Holds information about test suite such as it's name - * and pointer to dynamic library. Implemented as linked list. - */ -typedef struct TestSuiteReference { - char *name; //!< test suite name - char *directoryPath; //!< test suites path (eg. tests/libtestsuite) - void *library; //!< pointer to shared/dynamic library implementing the suite - - struct TestSuiteReference *next; //!< Pointer to next item in the list -} TestSuiteReference; - - -/*! - * Holds information about the tests that will be executed. - * - * Implemented as linked list. - */ -typedef struct TestCaseItem { - char *testName; - char *suiteName; - - char *description; - long requirements; - long timeout; - - InitTestInvironmentFp initTestEnvironment; - TestCaseSetUpFp testSetUp; - TestCaseFp testCase; - TestCaseTearDownFp testTearDown; - QuitTestInvironmentFp quitTestEnvironment; - - CountFailedAssertsFp countFailedAsserts; - - struct TestCaseItem *next; -} TestCase; - - -/*! Some function prototypes. Add the rest of functions and move to runner.h */ -TestCaseFp LoadTestCaseFunction(void *suite, char *testName); -InitTestInvironmentFp LoadInitTestInvironmentFunction(void *suite); -QuitTestInvironmentFp LoadQuitTestInvironmentFunction(void *suite); -TestCaseReference **QueryTestCaseReferences(void *library); -TestCaseSetUpFp LoadTestSetUpFunction(void *suite); -TestCaseTearDownFp LoadTestTearDownFunction(void *suite); -CountFailedAssertsFp LoadCountFailedAssertsFunction(void *suite); -void KillHungTestInChildProcess(int signum); -void UnloadTestSuites(TestSuiteReference *suites); -int FilterTestCase(TestCaseReference *testReference); -int HandleChildProcessReturnValue(int stat_lock); - - -/*! Pointers to selected logger implementation */ -RunStartedFp RunStarted = NULL; -RunEndedFp RunEnded = NULL; -SuiteStartedFp SuiteStarted = NULL; -SuiteEndedFp SuiteEnded = NULL; -TestStartedFp TestStarted = NULL; -TestEndedFp TestEnded = NULL; -AssertFp Assert = NULL; -AssertWithValuesFp AssertWithValues = NULL; -AssertSummaryFp AssertSummary = NULL; -LogFp Log = NULL; - - -/*! - * Scans the tests/ directory and returns the names - * of the dynamic libraries implementing the test suites. - * - * Note: currently function assumes that test suites names - * are in following format: libtestsuite.dylib or libtestsuite.so. - * - * Note: if only_selected_suite flags is non-zero, only the selected - * test will be loaded. - * - * \param directoryName Name of the directory which will be scanned - * \param extension What file extension is used with dynamic objects - * - * \return Pointer to TestSuiteReference which holds all the info about suites - * or NULL on failure - */ -TestSuiteReference * -ScanForTestSuites(char *directoryName, char *extension) -{ - typedef struct dirent Entry; - TestSuiteReference *suites = NULL; - TestSuiteReference *reference = NULL; - Entry *entry = NULL; - DIR *directory = NULL; - - if(directoryName == NULL || extension == NULL || - SDL_strlen(directoryName) == 0 || SDL_strlen(extension) == 0) { - return NULL; - } - - directory = opendir(directoryName); - if(!directory) { - fprintf(stderr, "Failed to open test suite directory: %s\n", directoryName); - perror("Error message"); - exit(2); - } - - while( (entry = readdir(directory)) ) { - // discards . and .. and hidden files starting with dot and directories etc. - if(strlen(entry->d_name) > 2 && entry->d_name[0] != '.' && entry->d_type == DT_REG) { - const char *delimiters = "."; - char *name = strtok(entry->d_name, delimiters); - char *ext = strtok(NULL, delimiters); - - if(name == NULL || ext == NULL) { - goto error; - } - - - int ok = 1; // on default, we want to include all tests - - // filter out all other suites but the selected test suite - if(only_selected_suite) { - ok = SDL_strncmp(selected_suite_name, name, NAME_BUFFER_SIZE) == 0; - } - - if(SDL_strncmp(name, DUMMY_TEST_NAME, NAME_BUFFER_SIZE) == 0) { - if(include_dummy_suite) { - ok = 1; - } else { - ok = 0; - } - } - - if(ok && SDL_strncmp(ext, extension, SDL_strlen(extension)) == 0) { - // create test suite reference - reference = (TestSuiteReference *) SDL_malloc(sizeof(TestSuiteReference)); - if(reference == NULL) { - goto error; - } - - memset(reference, 0, sizeof(TestSuiteReference)); - - const Uint32 dirSize = SDL_strlen(directoryName); - const Uint32 extSize = SDL_strlen(ext); - const Uint32 nameSize = SDL_strlen(name) + 1; - - // copy the name - reference->name = SDL_malloc(nameSize * sizeof(char)); - if(reference->name == NULL) { - goto error; - } - - SDL_snprintf(reference->name, nameSize, "%s", name); - - // copy the directory path - const Uint32 dpSize = dirSize + nameSize + 1 + extSize + 1; - reference->directoryPath = SDL_malloc(dpSize * sizeof(char)); - if(reference->directoryPath == NULL) { - goto error; - } - - SDL_snprintf(reference->directoryPath, dpSize, "%s%s.%s", - directoryName, name, ext); - - reference->next = suites; - suites = reference; - } - } - } - - goto finished; - - error: - if(reference) { - SDL_free(reference->name); - SDL_free(reference->directoryPath); - SDL_free(reference); - } - - // Unload all the suites that are loaded thus far - UnloadTestSuites(suites); - suites = NULL; - - finished: - if(directory) { - closedir(directory); - } - - return suites; -} - - -/*! - * Loads test suite which is implemented as dynamic library. - * - * \param suite Reference to test suite that'll be loaded - * - * \return Pointer to loaded test suite, or NULL if library could not be loaded - */ -void * -LoadTestSuite(const TestSuiteReference *suite) -{ - void *library = SDL_LoadObject(suite->directoryPath); - if(library == NULL) { - fprintf(stderr, "Loading %s failed\n", suite->name); - fprintf(stderr, "%s\n", SDL_GetError()); - } - - return library; -} - - -/*! - * Goes through all the given TestSuiteReferences - * and loads the dynamic libraries. Updates the suites - * parameter on-the-fly and returns it. - * - * \param suites Suites that will be loaded - * - * \return Updated TestSuiteReferences with pointer to loaded libraries - */ -TestSuiteReference * -LoadTestSuites(TestSuiteReference *suites) -{ - TestSuiteReference *reference = NULL; - for(reference = suites; reference; reference = reference->next) { - reference->library = LoadTestSuite(reference); - } - - return suites; -} - - -/*! - * Unloads the given TestSuiteReferences. Frees all - * the allocated resources including the dynamic libraries. - * - * \param suites TestSuiteReferences for deallocation process - */ -void -UnloadTestSuites(TestSuiteReference *suites) -{ - TestSuiteReference *ref = suites; - while(ref) { - if(ref->name) - SDL_free(ref->name); - - if(ref->directoryPath) - SDL_free(ref->directoryPath); - - if(ref->library) - SDL_UnloadObject(ref->library); - - TestSuiteReference *temp = ref->next; - SDL_free(ref); - ref = temp; - } - - suites = NULL; -} - - -/*! - * Goes through the previously loaded test suites and - * loads test cases from them. Test cases are filtered - * during the process. Function will only return the - * test cases which aren't filtered out. - * - * \param suites previously loaded test suites - * - * \return Test cases that survived filtering process. - */ -TestCase * -LoadTestCases(TestSuiteReference *suites) -{ - TestCase *testCases = NULL; - - TestSuiteReference *suiteReference = NULL; - for(suiteReference = suites; suiteReference; suiteReference = suiteReference->next) { - TestCaseReference **tests = QueryTestCaseReferences(suiteReference->library); - - TestCaseReference *testReference = NULL; - int counter = 0; - for(testReference = tests[counter]; testReference; testReference = tests[++counter]) { - //void *suite = suiteReference->library; - - // Load test case functions - InitTestInvironmentFp initTestEnvironment = LoadInitTestInvironmentFunction(suiteReference->library); - QuitTestInvironmentFp quitTestEnvironment = LoadQuitTestInvironmentFunction(suiteReference->library); - - TestCaseSetUpFp testSetUp = LoadTestSetUpFunction(suiteReference->library); - TestCaseTearDownFp testTearDown = LoadTestTearDownFunction(suiteReference->library); - - TestCaseFp testCase = LoadTestCaseFunction(suiteReference->library, testReference->name); - - CountFailedAssertsFp countFailedAsserts = LoadCountFailedAssertsFunction(suiteReference->library); - - // Do the filtering - if(FilterTestCase(testReference)) { - TestCase *item = SDL_malloc(sizeof(TestCase)); - memset(item, 0, sizeof(TestCase)); - - item->initTestEnvironment = initTestEnvironment; - item->quitTestEnvironment = quitTestEnvironment; - - item->testSetUp = testSetUp; - item->testTearDown = testTearDown; - - item->testCase = testCase; - - item->countFailedAsserts = countFailedAsserts; - - // copy suite name - int length = SDL_strlen(suiteReference->name) + 1; - item->suiteName = SDL_malloc(length); - if(item->suiteName == NULL) { - SDL_free(item); - return NULL; - } - strncpy(item->suiteName, suiteReference->name, length); - - // copy test name - length = SDL_strlen(testReference->name) + 1; - item->testName = SDL_malloc(length); - if(item->testName == NULL) { - SDL_free(item->suiteName); - SDL_free(item); - return NULL; - } - strncpy(item->testName, testReference->name, length); - - // copy test description - length = SDL_strlen(testReference->description) + 1; - item->description = SDL_malloc(length); - if(item->description == NULL) { - SDL_free(item->description); - SDL_free(item->suiteName); - SDL_free(item); - return NULL; - } - strncpy(item->description, testReference->description, length); - - item->requirements = testReference->requirements; - item->timeout = testReference->timeout; - - // prepend the list - item->next = testCases; - testCases = item; - - //printf("Added test: %s\n", testReference->name); - } - } - } - - return testCases; -} - - -/*! - * Unloads the given TestCases. Frees all the resources - * allocated for test cases. - * - * \param testCases Test cases to be deallocated - */ -void -UnloadTestCases(TestCase *testCases) -{ - TestCase *ref = testCases; - while(ref) { - if(ref->testName) - SDL_free(ref->testName); - - if(ref->suiteName) - SDL_free(ref->suiteName); - - if(ref->description) - SDL_free(ref->description); - - TestCase *temp = ref->next; - SDL_free(ref); - ref = temp; - } - - testCases = NULL; -} - - -/*! - * Filters a test case based on its properties in TestCaseReference and user - * preference. - * - * \return Non-zero means test will be added to execution list, zero means opposite - */ -int -FilterTestCase(TestCaseReference *testReference) -{ - int retVal = 1; - - if(testReference->enabled == TEST_DISABLED) { - retVal = 0; - } - - if(only_selected_test) { - if(SDL_strncmp(testReference->name, selected_test_name, NAME_BUFFER_SIZE) == 0) { - retVal = 1; - } else { - retVal = 0; - } - } - - if(only_tests_with_string) { - if(strstr(testReference->name, testcase_name_substring) != NULL) { - retVal = 1; - } else { - retVal = 0; - } - } - - return retVal; -} - - -/*! - * Loads the test case references from the given test suite. - - * \param library Previously loaded dynamic library AKA test suite - * \return Pointer to array of TestCaseReferences or NULL if function failed - */ -TestCaseReference ** -QueryTestCaseReferences(void *library) -{ - TestCaseReference **(*suite)(void); - - suite = (TestCaseReference **(*)(void)) SDL_LoadFunction(library, "QueryTestSuite"); - if(suite == NULL) { - fprintf(stderr, "Loading QueryTestCaseReferences() failed.\n"); - fprintf(stderr, "%s\n", SDL_GetError()); - } - - TestCaseReference **tests = suite(); - if(tests == NULL) { - fprintf(stderr, "Failed to load test references.\n"); - fprintf(stderr, "%s\n", SDL_GetError()); - } - - return tests; -} - - -/*! - * Loads test case from a test suite - * - * \param suite a test suite - * \param testName Name of the test that is going to be loaded - * - * \return Function Pointer (TestCase) to loaded test case, NULL if function failed - */ -TestCaseFp -LoadTestCaseFunction(void *suite, char *testName) -{ - TestCaseFp test = (TestCaseFp) SDL_LoadFunction(suite, testName); - if(test == NULL) { - fprintf(stderr, "Loading test %s failed, test == NULL\n", testName); - fprintf(stderr, "%s\n", SDL_GetError()); - } - - return test; -} - - -/*! - * Loads function that sets up a fixture for a test case. Note: if there's - * no SetUp function present in the suite the function will return NULL. - * - * \param suite Used test suite - * - * \return Function pointer to test case's set up function - */ -TestCaseSetUpFp -LoadTestSetUpFunction(void *suite) { - return (TestCaseSetUpFp) SDL_LoadFunction(suite, "SetUp"); -} - - -/*! - * Loads function that tears down a fixture for a test case. Note: if there's - * no TearDown function present in the suite the function will return NULL. - * - * \param suite Used test suite - * - * \return Function pointer to test case's tear down function - */ -TestCaseTearDownFp -LoadTestTearDownFunction(void *suite) { - return (TestCaseTearDownFp) SDL_LoadFunction(suite, "TearDown"); -} - - -/*! - * Loads function that initialises the test environment for - * a test case in the given suite. - * - * \param suite Used test suite - * - * \return Function pointer (InitTestInvironmentFp) which points to loaded init function. NULL if function fails. - */ -InitTestInvironmentFp -LoadInitTestInvironmentFunction(void *suite) { - InitTestInvironmentFp testEnvInit = (InitTestInvironmentFp) SDL_LoadFunction(suite, "_InitTestEnvironment"); - if(testEnvInit == NULL) { - fprintf(stderr, "Loading _InitTestInvironment function failed, testEnvInit == NULL\n"); - fprintf(stderr, "%s\n", SDL_GetError()); - } - - return testEnvInit; -} - - -/*! - * Loads function that deinitialises the test environment (and returns - * the test case's result) created for the test case in the given suite. - * - * \param suite Used test suite - * - * \return Function pointer (QuitTestInvironmentFp) which points to loaded init function. NULL if function fails. - */ -QuitTestInvironmentFp -LoadQuitTestInvironmentFunction(void *suite) { - QuitTestInvironmentFp testEnvQuit = (QuitTestInvironmentFp) SDL_LoadFunction(suite, "_QuitTestEnvironment"); - if(testEnvQuit == NULL) { - fprintf(stderr, "Loading _QuitTestEnvironment function failed, testEnvQuit == NULL\n"); - fprintf(stderr, "%s\n", SDL_GetError()); - } - - return testEnvQuit; -} - - -/*! - * Loads function that returns failed assert count in the current - * test environment - * - * \param suite Used test suite - * - * \return Function pointer to _CountFailedAsserts function - */ -CountFailedAssertsFp -LoadCountFailedAssertsFunction(void *suite) { - CountFailedAssertsFp countFailedAssert = (CountFailedAssertsFp) SDL_LoadFunction(suite, "_CountFailedAsserts"); - if(countFailedAssert == NULL) { - fprintf(stderr, "Loading _CountFailedAsserts function failed, countFailedAssert == NULL\n"); - fprintf(stderr, "%s\n", SDL_GetError()); - } - - return countFailedAssert; -} - -#define USE_SDL_TIMER_FOR_TIMEOUT - -/*! - * Set timeout for test. - * - * \param timeout Timeout interval in seconds! - * \param callback Function that will be called after timeout has elapsed - */ -void -SetTestTimeout(int timeout, void (*callback)(int)) -{ - if(callback == NULL) { - fprintf(stderr, "Error: timeout callback can't be NULL"); - } - - if(timeout < 0) { - fprintf(stderr, "Error: timeout value must be bigger than zero."); - } - - int tm = (timeout > universal_timeout ? timeout : universal_timeout); - -#ifdef USE_SDL_TIMER_FOR_TIMEOUT - /* Init SDL timer if not initialized before */ - if(SDL_WasInit(SDL_INIT_TIMER) == 0) { - if(SDL_InitSubSystem(SDL_INIT_TIMER)) { - fprintf(stderr, "Error: Failed to init timer subsystem"); - fprintf(stderr, "%s\n", SDL_GetError()); - } - } - - /* Note: - * SDL_Init(SDL_INIT_TIMER) should be successfully called before using this - */ - int timeoutInMilliseconds = tm * 1000; - - SDL_TimerID timerID = SDL_AddTimer(timeoutInMilliseconds, (SDL_TimerCallback) callback, 0x0); - if(timerID == 0) { - fprintf(stderr, "Error: Creation of SDL timer failed.\n"); - fprintf(stderr, "Error: %s\n", SDL_GetError()); - } -#else - signal(SIGALRM, callback); - alarm((unsigned int) tm); -#endif -} - - -/*! - * Kills test that hungs. Test hungs when its execution - * takes longer than timeout specified for it. - * - * When test will be killed SIG_ALRM will be triggered and - * it'll call this function which kills the test process. - * - * Note: if runner is executed with --in-proc then hung tests - * can't be killed - * - * \param signum - */ -void -KillHungTestInChildProcess(int signum) -{ - (void)signum; // keeps the compiler silent about unused variable - - exit(TEST_RESULT_KILLED); -} - -/*! - * Checks if given test case can be executed on the current platform. - * - * \param testCase Test to be checked - * \returns 1 if test is runnable, otherwise 0. On error returns -1 - */ -int -CheckTestRequirements(TestCase *testCase) -{ - int retVal = 1; - - if(testCase == NULL) { - fprintf(stderr, "TestCase parameter can't be NULL"); - return -1; - } - - if(testCase->requirements & TEST_REQUIRES_AUDIO) { - retVal = PlatformSupportsAudio(); - } - - if(testCase->requirements & TEST_REQUIRES_STDIO) { - retVal = PlatformSupportsStdio(); - } - - - return retVal; -} - - -/* - * Execute a test. Loads the test, executes it and - * returns the tests return value to the caller. - * - * \param testItem Test to be executed - * \param test result - */ -int -RunTest(TestCase *testCase, Uint64 execKey) -{ - if(!testCase) { - return -1; - } - - int runnable = CheckTestRequirements(testCase); - if(runnable != 1) { - return TEST_RESULT_SKIPPED; - } - - if(testCase->timeout > 0 || universal_timeout > 0) { - if(execute_inproc) { - Log(time(0), "Test asked for timeout which is not supported."); - } - else { - SetTestTimeout(testCase->timeout, KillHungTestInChildProcess); - } - } - - testCase->initTestEnvironment(execKey, execute_inproc); - - if(testCase->testSetUp) { - testCase->testSetUp(0x0); - } - - int cntFailedAsserts = testCase->countFailedAsserts(); - if(cntFailedAsserts != 0) { - return TEST_RESULT_SETUP_FAILURE; - } - - testCase->testCase(0x0); - - if(testCase->testTearDown) { - testCase->testTearDown(0x0); - } - - return testCase->quitTestEnvironment(); -} - - -/*! - * Sets up a test case. Decideds wheter the test will - * be executed in-proc or out-of-proc. - * - * \param testItem The test case that will be executed - * \param execKey Execution key for the test case - * - * \return The return value of the test. Zero means success, non-zero failure. - */ -int -ExecuteTest(TestCase *testItem, Uint64 execKey) { - int retVal = -1; - - if(execute_inproc) { - retVal = RunTest(testItem, execKey); - } else { - int childpid = fork(); - if(childpid == 0) { - exit(RunTest(testItem, execKey)); - } else { - int stat_lock = -1; - wait(&stat_lock); - - retVal = HandleChildProcessReturnValue(stat_lock); - } - } - - if(retVal == TEST_RESULT_SKIPPED) { - testSkipCount++; - totalTestSkipCount++; - } - else if(retVal) { - totalTestFailureCount++; - testFailureCount++; - } - else { - totalTestPassCount++; - testPassCount++; - } - - // return the value for logger - return retVal; -} - - -/*! - * If using out-of-proc execution of tests. This function - * will handle the return value of the child process - * and interprets it to the runner. Also prints warnings - * if child was aborted by a signela. - * - * \param stat_lock information about the exited child process - * - * \return 0 if test case succeeded, 1 otherwise - */ -int -HandleChildProcessReturnValue(int stat_lock) -{ - int returnValue = -1; - - if(WIFEXITED(stat_lock)) { - returnValue = WEXITSTATUS(stat_lock); - } else if(WIFSIGNALED(stat_lock)) { - int signal = WTERMSIG(stat_lock); - // \todo add this to logger (add signal number) - Log(time(0), "FAILURE: test was aborted due to %d\n", signal); - returnValue = 1; - } - - return returnValue; -} - - -/*! - * Generates a random run seed for the harness. Seed - * can contain characters 0-9A-Z - * - * \param length The length of the generated seed - * - * \returns The generated seed - */ -char * -GenerateRunSeed(const int length) -{ - if(length <= 0) { - fprintf(stderr, "Error: length of the harness seed can't be less than zero\n"); - return NULL; - } - - char *seed = SDL_malloc((length + 1) * sizeof(char)); - if(seed == NULL) { - fprintf(stderr, "Error: malloc for run seed failed\n"); - return NULL; - } - - RND_CTX randomContext; - - utl_randomInitTime(&randomContext); - - int counter = 0; - for( ; counter < length - 1; ++counter) { - int number = abs(utl_random(&randomContext)); - char ch = (char) (number % (91 - 48)) + 48; - - if(ch >= 58 && ch <= 64) { - ch = 65; - } - - seed[counter] = ch; - } - - seed[counter] = '\0'; - - return seed; -} - -/*! - * Sets up the logger. - * - * \return Logger data structure (that needs be deallocated) - */ -LoggerData * -SetUpLogger(const int log_stdout_enabled, const int xml_enabled, const int xsl_enabled, - const int custom_xsl_enabled, const char *defaultXslSheet, const time_t timestamp) -{ - LoggerData *loggerData = SDL_malloc(sizeof(LoggerData)); - if(loggerData == NULL) { - fprintf(stderr, "Error: Logger data structure not allocated."); - return NULL; - } - memset(loggerData, 0, sizeof(LoggerData)); - - loggerData->level = (enable_verbose_logger ? LOGGER_VERBOSE : LOGGER_TERSE); - - if(log_stdout_enabled == 1) { - loggerData->stdoutEnabled = 1; - loggerData->filename = NULL; - } else { - loggerData->stdoutEnabled = 0; - - const char *extension = (xml_enabled ? "xml" : "log"); - - // create directory (if it doesn't exist yet) - unsigned int mode = S_IRWXU | S_IRGRP | S_ISUID; - mkdir(log_directory, mode); - - char *timeString = TimestampToStringWithFormat(timestamp, "%Y%m%d_%H:%M:%S"); - - - /* Combine and create directory for log file */ - const Uint32 directoryLength = SDL_strlen(log_directory); - const Uint32 basenameLength = SDL_strlen(log_basename); - const Uint32 seedLength = SDL_strlen(runSeed); - const Uint32 extensionLength = SDL_strlen(extension); - - const Uint32 timeLength = SDL_strlen(timeString); - - // couple of extras bytes for '/', '-', '.' and '\0' at the end - const Uint32 length = directoryLength + basenameLength + seedLength - + extensionLength + timeLength + 5; - - if(length <= 0) { - return NULL; - } - - char *filename = SDL_malloc(length); - if(filename == NULL) { - SDL_free(loggerData); - - fprintf(stderr, "Error: Failed to allocate memory for filename of log"); - return NULL; - } - memset(filename, 0, length); - - SDL_snprintf(filename, length, "%s%c%s-%s-%s.%s", log_directory, - DIRECTORY_SEPARATOR, log_basename, timeString, runSeed, extension); - - loggerData->filename = filename; - } - - if(xml_enabled) { - char *sheet = NULL; - if(xsl_enabled) { - sheet = (char *) defaultXslSheet; - } - - if(custom_xsl_enabled) { - sheet = xsl_stylesheet_name; - } - - loggerData->custom = sheet; - } - - if(xml_enabled) { - RunStarted = XMLRunStarted; - RunEnded = XMLRunEnded; - - SuiteStarted = XMLSuiteStarted; - SuiteEnded = XMLSuiteEnded; - - TestStarted = XMLTestStarted; - TestEnded = XMLTestEnded; - - Assert = XMLAssert; - AssertWithValues = XMLAssertWithValues; - AssertSummary = XMLAssertSummary; - - Log = XMLLog; - } else { - RunStarted = PlainRunStarted; - RunEnded = PlainRunEnded; - - SuiteStarted = PlainSuiteStarted; - SuiteEnded = PlainSuiteEnded; - - TestStarted = PlainTestStarted; - TestEnded = PlainTestEnded; - - Assert = PlainAssert; - AssertWithValues = PlainAssertWithValues; - AssertSummary = PlainAssertSummary; - - Log = PlainLog; - } - - return loggerData; -} - - -/*! - * Prints usage information - */ -void -PrintUsage() { - printf("Usage: ./runner [--in-proc] [--show-tests] [--verbose]\n"); - printf(" [--logfile [BASENAME]] [--logdir DIR] [--xml]\n"); - printf(" [--xsl [STYLESHEET]] [--seed VALUE] [--iterations VALUE]\n"); - printf(" [--exec-key KEY] [--timeout VALUE] [--test TEST]\n"); - printf(" [--name-contains SUBSTR] [--suite SUITE] [--include-dummy]\n"); - printf(" [--version] [--help]\n"); - printf("Options:\n"); - printf(" --in-proc Executes tests in-process\n"); - printf(" --show-tests Prints out all the executable tests\n"); - printf(" -v --verbose Enables verbose logging\n"); - printf(" --logfile [BASENAME] Enables logging to a file. If BASENAME is\n"); - printf(" specified it'll be used as basename for\n"); - printf(" the log file\n"); - printf(" --logdir DIR Define directory for logs. Defaults to 'logs'\n"); - printf(" --xml Enables XML logger\n"); - printf(" --xsl [STYLESHEET] Adds XSL stylesheet to the XML test reports for\n"); - printf(" browser viewing. Optionally uses the specified XSL\n"); - printf(" file or URL instead of the default one\n"); - printf(" --seed VALUE Specify fuzzing seed for the harness\n"); - printf(" --iterations VALUE Specify how many times a test will be executed\n"); - printf(" --exec-key KEY Run test(s) with specific execution key\n"); - printf(" -tm --timeout VALUE Specify common timeout value for all tests\n"); - printf(" Timeout is given in seconds and it'll override\n"); - printf(" test specific timeout value only if the given\n"); - printf(" value is greater than the test specific value\n"); - printf(" note: doesn't work with --in-proc option.\n"); - printf(" -t --test TEST Executes only tests with given name\n"); - printf(" -ts --name-contains SUBSTR Executes only tests that have given\n"); - printf(" substring in test name\n"); - printf(" -s --suite SUITE Executes only the given test suite\n"); - printf(" --include-dummy Includes dummy test suite in the test run\n"); - - printf(" --version Print version information\n"); - printf(" -h --help Print this help\n"); -} - - -/*! - * Parse command line arguments - * - * \param argc Count of command line arguments - * \param argv Array of commond lines arguments - */ -void -ParseOptions(int argc, char *argv[]) -{ - int i; - - for (i = 1; i < argc; ++i) { - const char *arg = argv[i]; - if(SDL_strcmp(arg, "--in-proc") == 0) { - execute_inproc = 1; - } - else if(SDL_strcmp(arg, "--show-tests") == 0) { - only_print_tests = 1; - } - else if(SDL_strcmp(arg, "--xml") == 0) { - xml_enabled = 1; - } - else if(SDL_strcmp(arg, "--verbose") == 0 || SDL_strcmp(arg, "-v") == 0) { - enable_verbose_logger = 1; - } - else if(SDL_strcmp(arg, "--logdir") == 0) { - char *dirString = NULL; - - if( (i + 1) < argc && argv[i+1][0] != '-') { - dirString = argv[++i]; - } else { - printf("runner: dir is missing\n"); - PrintUsage(); - exit(1); - } - - memset(log_directory, 0, NAME_BUFFER_SIZE); - memcpy(log_directory, dirString, SDL_strlen(dirString)); - - log_stdout_enabled = 0; - } - else if(SDL_strcmp(arg, "--logfile") == 0) { - char *fileString = NULL; - - if( (i + 1) < argc && argv[i+1][0] != '-') { - fileString = argv[++i]; - } else { - fileString = DEFAULT_LOG_FILENAME; - } - - memset(log_basename, 0, NAME_BUFFER_SIZE); - memcpy(log_basename, fileString, SDL_strlen(fileString)); - - log_stdout_enabled = 0; - } - else if(SDL_strcmp(arg, "--timeout") == 0 || SDL_strcmp(arg, "-tm") == 0) { - universal_timeout_enabled = 1; - char *timeoutString = NULL; - - if( (i + 1) < argc && argv[i+1][0] != '-') { - timeoutString = argv[++i]; - } else { - printf("runner: timeout is missing\n"); - PrintUsage(); - exit(1); - } - - universal_timeout = atoi(timeoutString); - } - else if(SDL_strcmp(arg, "--seed") == 0) { - userRunSeed = 1; - - if( (i + 1) < argc && argv[i+1][0] != '-') { - runSeed = argv[++i]; - } else { - printf("runner: seed value is missing\n"); - PrintUsage(); - exit(1); - } - //!Ê\todo should the seed be copied to a buffer? - } - else if(SDL_strcmp(arg, "--iterations") == 0) { - char *iterationsString = NULL; - if( (i + 1) < argc && argv[i+1][0] != '-') { - iterationsString = argv[++i]; - } else { - printf("runner: iterations value is missing\n"); - PrintUsage(); - exit(1); - } - - testInvocationCount = atoi(iterationsString); - if(testInvocationCount < 1) { - printf("Iteration value has to bigger than 0.\n"); - exit(1); - } - } - else if(SDL_strcmp(arg, "--exec-key") == 0) { - char *execKeyString = NULL; - if( (i + 1) < argc && argv[i+1][0] != '-') { - execKeyString = argv[++i]; - } else { - printf("runner: execkey value is missing\n"); - PrintUsage(); - exit(1); - } - - int ret = sscanf(execKeyString, "%llx", &userExecKey); - if(ret != 1) { - fprintf(stderr, "Error: Failed to parse exec-key option"); - exit(1); - } - } - else if(SDL_strcmp(arg, "--test") == 0 || SDL_strcmp(arg, "-t") == 0) { - only_selected_test = 1; - char *testName = NULL; - - if( (i + 1) < argc && argv[i+1][0] != '-') { - testName = argv[++i]; - } else { - printf("runner: test name is missing\n"); - PrintUsage(); - exit(1); - } - - memset(selected_test_name, 0, NAME_BUFFER_SIZE); - strncpy(selected_test_name, testName, NAME_BUFFER_SIZE); - } - else if(SDL_strcmp(arg, "--xsl") == 0) { - xsl_enabled = 1; - - if( (i + 1) < argc && argv[i+1][0] != '-') { - char *stylesheet = argv[++i]; - if(stylesheet[0] != '-') { - custom_xsl_enabled = 1; - - memset(xsl_stylesheet_name, 0, NAME_BUFFER_SIZE); - strncpy(xsl_stylesheet_name, stylesheet, NAME_BUFFER_SIZE); - } - } - } - else if(SDL_strcmp(arg, "--name-contains") == 0 || SDL_strcmp(arg, "-ts") == 0) { - only_tests_with_string = 1; - char *substring = NULL; - - if( (i + 1) < argc && argv[i+1][0] != '-') { - substring = argv[++i]; - } else { - printf("runner: substring of test name is missing\n"); - PrintUsage(); - exit(1); - } - - memset(testcase_name_substring, 0, NAME_BUFFER_SIZE); - strncpy(testcase_name_substring, strdup(substring), NAME_BUFFER_SIZE); - } - else if(SDL_strcmp(arg, "--suite") == 0 || SDL_strcmp(arg, "-s") == 0) { - only_selected_suite = 1; - - char *suiteName = NULL; - if( (i + 1) < argc && argv[i+1][0] != '-') { - suiteName = argv[++i]; - } else { - printf("runner: suite name is missing\n"); - PrintUsage(); - exit(1); - } - - memset(selected_suite_name, 0, NAME_BUFFER_SIZE); - strcpy(selected_suite_name, suiteName); - } - else if(SDL_strcmp(arg, "--include-dummy") == 0) { - include_dummy_suite = 1; - } - else if(SDL_strcmp(arg, "--version") == 0) { - fprintf(stdout, "SDL test harness (version %s)\n", PACKAGE_VERSION); - - // print: Testing against SDL version fuu (rev: bar) - - exit(0); - } - else if(SDL_strcmp(arg, "--help") == 0 || SDL_strcmp(arg, "-h") == 0) { - PrintUsage(); - exit(0); - } - else { - printf("runner: unknown command '%s'\n", arg); - PrintUsage(); - exit(0); - } - } -} - -void -InitRunner() -{ - // Inits some global buffers to their default values - memcpy(log_basename, (void *)DEFAULT_LOG_FILENAME, SDL_strlen(DEFAULT_LOG_FILENAME)); - memcpy(log_directory, (void *)DEFAULT_LOG_DIRECTORY, SDL_strlen(DEFAULT_LOG_DIRECTORY)); - - memset(selected_test_name, 0, NAME_BUFFER_SIZE); - memset(selected_suite_name, 0, NAME_BUFFER_SIZE); - memset(testcase_name_substring, 0, NAME_BUFFER_SIZE); - memset(xsl_stylesheet_name, 0, NAME_BUFFER_SIZE); -} - - -/*! - * Entry point for test runner - * - * \param argc Count of command line arguments - * \param argv Array of commond lines arguments - */ -int -main(int argc, char *argv[]) -{ - InitRunner(); - - ParseOptions(argc, argv); - - int suiteCounter = 0; - -#if defined(linux) || defined( __linux) - char *extension = "so"; -#else - char *extension = "dylib"; -#endif - - const Uint32 startTicks = SDL_GetTicks(); - - TestSuiteReference *suites = ScanForTestSuites(DEFAULT_TEST_DIRECTORY, extension); - if(suites == NULL) { - fprintf(stderr, "No test suites loaded.\n"); - fprintf(stderr, "Compile you suites and install them to tests/\n"); - return 2; - } - suites = LoadTestSuites(suites); - - TestCase *testCases = LoadTestCases(suites); - if(testCases == NULL) { - fprintf(stderr, "Found zero test cases\n"); - fprintf(stderr, "Check out your command line options\n"); - return 2; - } - - // if --show-tests option is given, only print tests and exit - if(only_print_tests) { - TestCase *testItem = NULL; - char *lastSuiteName = NULL; - for(testItem = testCases; testItem; testItem = testItem->next) { - if ((lastSuiteName == NULL) || (strcmp(lastSuiteName, testItem->suiteName)!=0)) { - lastSuiteName = testItem->suiteName; - printf ("%s:\n", lastSuiteName); - } - printf(" %s: %s", testItem->testName, testItem->description); - if (testItem->timeout>0) { - printf (" (timeout: %i sec)", testItem->timeout); - } - printf ("\n"); - } - - return 0; - } - - if(userRunSeed == 0) { - runSeed = GenerateRunSeed(16); - if(runSeed == NULL) { - fprintf(stderr, "Error: Generating harness seed failed\n"); - return 2; - } - } - - const time_t startTimestamp = time(0); - - LoggerData *loggerData = SetUpLogger(log_stdout_enabled, xml_enabled, - xsl_enabled, custom_xsl_enabled, defaultXSLStylesheet, startTimestamp); - if(loggerData == NULL) { - printf("Failed to create a logger.\n"); - return 2; - } - - if(log_stdout_enabled == 0) { - printf("Runner is executing the tests.\n"); - if(enable_verbose_logger) { - printf("Logging level is set to verbose.\n"); - } - printf("Test report is created to: %s\n", loggerData->filename); - fflush(stdout); - } - - RunStarted(argc, argv, runSeed, startTimestamp, loggerData); - - // logger data is no longer used so free it - SDL_free(loggerData->filename); - SDL_free(loggerData); - - - // validate the parsed command options - // \todo add a lot more and refactor. There are many more combinations - // of commands that doesn't make sense together - if(execute_inproc && universal_timeout_enabled) { - Log(time(0), "Test timeout is not supported with in-proc execution."); - Log(time(0), "Timeout will be disabled..."); - - universal_timeout_enabled = 0; - universal_timeout = -1; - } /* - if(userExecKey && testInvocationCount > 1 || userRunSeed) { - printf("The given combination of command line options doesn't make sense\n"); - printf("--exec-key should only be used to rerun failed fuzz tests\n"); - }*/ - - char *currentSuiteName = NULL; - int suiteStartTime = SDL_GetTicks(); - - int notFirstSuite = 0; - int startNewSuite = 1; - TestCase *testItem = NULL; - for(testItem = testCases; testItem; testItem = testItem->next) { - if(currentSuiteName && strncmp(currentSuiteName, testItem->suiteName, NAME_BUFFER_SIZE) != 0) { - startNewSuite = 1; - } - - if(startNewSuite) { - if(notFirstSuite) { - const double suiteRuntime = (SDL_GetTicks() - suiteStartTime) / 1000.0f; - - SuiteEnded(testPassCount, testFailureCount, testSkipCount, time(0), - suiteRuntime); - } - - suiteStartTime = SDL_GetTicks(); - - currentSuiteName = testItem->suiteName; - SuiteStarted(currentSuiteName, time(0)); - testFailureCount = testPassCount = testSkipCount = 0; - suiteCounter++; - - startNewSuite = 0; - notFirstSuite = 1; - } - - int currentIteration = testInvocationCount; - while(currentIteration > 0) { - Uint64 execKey = 5; - if(userExecKey != 0) { - execKey = userExecKey; - } else { - execKey = GenerateExecKey(runSeed, testItem->suiteName, - testItem->testName, currentIteration); - } - - TestStarted(testItem->testName, testItem->suiteName, - testItem->description, execKey, time(0)); - - const Uint32 testTimeStart = SDL_GetTicks(); - - int retVal = ExecuteTest(testItem, execKey); - - const double testTotalRuntime = (SDL_GetTicks() - testTimeStart) / 1000.0f; - - TestEnded(testItem->testName, testItem->suiteName, retVal, time(0), testTotalRuntime); - - currentIteration--; - } - } - - if(currentSuiteName) { - SuiteEnded(testPassCount, testFailureCount, testSkipCount, time(0), - (SDL_GetTicks() - suiteStartTime) / 1000.0f); - } - - UnloadTestCases(testCases); - UnloadTestSuites(suites); - - const Uint32 endTicks = SDL_GetTicks(); - const double totalRunTime = (endTicks - startTicks) / 1000.0f; - - RunEnded(totalTestPassCount + totalTestFailureCount + totalTestSkipCount, suiteCounter, - totalTestPassCount, totalTestFailureCount, totalTestSkipCount, time(0), totalRunTime); - - // Some SDL subsystem might be init'ed so shut them down - SDL_Quit(); - - return (totalTestFailureCount ? 1 : 0); -} diff --git a/test/test-automation/src/runner/support.c b/test/test-automation/src/runner/support.c deleted file mode 100644 index 0f8e89d3f..000000000 --- a/test/test-automation/src/runner/support.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 "support.h" - -#include - -int -PlatformSupportsAudio() -{ - int retValue = 0; - -#ifdef SDL_AUDIO_DRIVER_COREAUDIO - retValue = 1; -#endif -#ifdef SDL_AUDIO_DRIVER_OSS - retValue = 1; -#endif - - return retValue; -} - -int -PlatformSupportsStdio() -{ - int retValue = 0; - -#ifdef HAVE_STDIO_H - retValue = 1; -#endif - - return retValue; -} - - -/* - -Example of implementing new PlatformSupportXXX functions. The function -should return 1 if the feature is supported. Otherwise return 0. - -Add call to the implemented function to runner.c in function -CheckTestRequirements. Use the current implementation as a guide. - -Also add TEST_REQUIRES_XXX to SDL_test.h and use it in your tests -TestCaseReference. In this case, you'd add TEST_REQUIRES_OPENGL to -SDL_test.h - -int -PlatformSupportsOpenGL() { - int retValue = 0; -#define SDL_VIDEO_OPENGL - retValue = 1; -#endif - - return retValue; -} - -*/ diff --git a/test/test-automation/style.xsl b/test/test-automation/style.xsl deleted file mode 100644 index 01f800adc..000000000 --- a/test/test-automation/style.xsl +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - -Test report - - - - - - -

Test Report

-
- Start time:
- Total runtime: seconds.
- Fuzz seed:
- Harness parameters: - - - - - -
- Statistics:
-
- Executed test suites.
- Tests in total: (passed: , failed: , skipped: ) -
-
-
-
- Test Results
- [Show All Tests] | - [Show Everything] -
-
- - -
- Suite: () -
- Tests: passed , failed , skipped .
- Total runtime: seconds.
- [Show tests] -
- -
- Test : - - - - - - - - () - - - - exec-key: - (Total runtime: seconds)
- Description:
- [Show Assert Summary]
-
- -
- : - - - - - - . - Message: -
-
- Asserts in total: (passed: , failed: ) -
-
-
-
-
-
-
-
- - - - -
-
- diff --git a/test/test-automation/tests/testaudio/Makefile.am b/test/test-automation/tests/testaudio/Makefile.am deleted file mode 100644 index 6916c49b5..000000000 --- a/test/test-automation/tests/testaudio/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestaudio.la -libtestaudio_la_SOURCES = testaudio.c -libtestaudio_la_CLAGS = -fPIC -g -libtestaudio_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testaudio/testaudio.c b/test/test-automation/tests/testaudio/testaudio.c deleted file mode 100644 index 511a78fe4..000000000 --- a/test/test-automation/tests/testaudio/testaudio.c +++ /dev/null @@ -1,182 +0,0 @@ -/** - * Original code: automated SDL audio test written by Edgar Simo "bobbens" - * New/updated tests: aschiffler at ferzkopp dot net - */ - -#include - -#include - -#include "../../include/SDL_test.h" - -/* Test cases */ -static const TestCaseReference test1 = - (TestCaseReference){ "audio_enumerateAndNameAudioDevices", "Enumerate and name available audio devices (output and capture)", TEST_ENABLED, TEST_REQUIRES_AUDIO, 0}; - -static const TestCaseReference test2 = - (TestCaseReference){ "audio_enumerateAndNameAudioDevicesNegativeTests", "Netative tests around enumeration and naming of audio devices.", TEST_ENABLED, TEST_REQUIRES_AUDIO, 0}; - -static const TestCaseReference test3 = - (TestCaseReference){ "audio_printAudioDrivers", "Checks available audio driver names.", TEST_ENABLED, TEST_REQUIRES_AUDIO, 0}; - -static const TestCaseReference test4 = - (TestCaseReference){ "audio_printCurrentAudioDriver", "Checks current audio driver name with initialized audio.", TEST_ENABLED, TEST_REQUIRES_AUDIO, 0}; - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, &test2, &test3, &test4, NULL -}; - - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -/* Fixture */ - -void -SetUp(void *arg) -{ - /* Start SDL. */ - int ret = SDL_Init( SDL_INIT_AUDIO ); - AssertTrue(ret==0, "SDL_Init(SDL_INIT_AUDIO): %s", SDL_GetError()); -} - -void -TearDown(void *arg) -{ - /* Quit SDL. */ - SDL_Quit(); -} - -/* Test case functions */ - -/** - * \brief Enumerate and name available audio devices (output and capture). - * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetNumAudioDevices - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioDeviceName - */ -int audio_enumerateAndNameAudioDevices() -{ - int ret; - int t, tt; - int i, n, nn; - const char *name, *nameAgain; - - /* Iterate over types: t=0 output device, t=1 input/capture device */ - for (t=0; t<2; t++) { - - /* Get number of devices. */ - n = SDL_GetNumAudioDevices(t); - AssertTrue(n>=0, - "Number of %s devices < 0, reported as %i: %s", - (t) ? "output" : "capture", - n, - SDL_GetError()); - - /* Variation of non-zero type */ - if (t==1) { - tt = t + RandomIntegerInRange(1,10); - nn = SDL_GetNumAudioDevices(tt); - AssertTrue(n==nn, "SDL_GetNumAudioDevices(%i) : expected same number of audio devices %i, got %i", tt, n, nn); - nn = SDL_GetNumAudioDevices(-tt); - AssertTrue(n==nn, "SDL_GetNumAudioDevices(%i) : expected same number of audio devices %i, got %i", -tt, n, nn); - } - - /* List devices. */ - if (n>0) { - for (i=0; i0, "SDL_GetAudioDeviceName(%i, %i): returned empty name string", i, t); - if (t==1) { - /* Also try non-zero type */ - nameAgain = SDL_GetAudioDeviceName(i, tt); - AssertTrue(nameAgain != NULL, "SDL_GetAudioDeviceName(%i, %i): returned NULL name", i, tt); - AssertTrue(strlen(nameAgain)>0, "SDL_GetAudioDeviceName(%i, %i): returned empty name string", i, tt); - AssertTrue(strcmp(name, nameAgain)==0, - "SDL_GetAudioDeviceName(%i, %i): returned unexpected name string %s, expected %s", - i, tt, nameAgain, name); - } - } - } - } -} - -/** - * \brief Negative tests around enumeration and naming of audio devices. - * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetNumAudioDevices - * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioDeviceName - */ -int audio_enumerateAndNameAudioDevicesNegativeTests() -{ - int ret; - int t; - int i, j, no, nc; - const char *name; - - /* Get number of devices. */ - no = SDL_GetNumAudioDevices(0); - nc = SDL_GetNumAudioDevices(1); - - /* Invalid device index when getting name */ - for (t=0; t<2; t++) { - /* Negative device index */ - i = -1; - name = SDL_GetAudioDeviceName(i, t); - AssertTrue(name == NULL, "SDL_GetAudioDeviceName(%i, %i): returned a name, should return NULL", i, t); - - /* Device index past range */ - for (j=0; j<3; j++) { - i = (t) ? nc+j : no+j; - name = SDL_GetAudioDeviceName(i, t); - AssertTrue(name == NULL, "SDL_GetAudioDeviceName(%i, %i): returned a name, should return NULL", i, t); - } - - /* Capture index past capture range but within output range */ - if ((no>0) && (no>nc) && (t==1)) { - i = no-1; - name = SDL_GetAudioDeviceName(i, t); - AssertTrue(name == NULL, "SDL_GetAudioDeviceName(%i, %i): returned a name, should return NULL", i, t); - } - } -} - -/** - * @brief Checks available audio driver names. - */ -int audio_printAudioDrivers() -{ - int i, n; - const char *name; - - /* Get number of drivers */ - n = SDL_GetNumAudioDrivers(); - AssertTrue(n>=0, "Number of audio drivers >= 0"); - - /* List drivers. */ - if (n>0) - { - for (i=0; i0, "name empty"); - } - } -} - -/** - * @brief Checks current audio driver name with initialized audio. - */ -int audio_printCurrentAudioDriver() -{ - int ret; - const char *name; - - /* Check current audio driver */ - name = SDL_GetCurrentAudioDriver(); - AssertTrue(name != NULL, "name != NULL"); - AssertTrue(strlen(name)>0, "name empty"); -} diff --git a/test/test-automation/tests/testclipboard/Makefile.am b/test/test-automation/tests/testclipboard/Makefile.am deleted file mode 100644 index 4fb4800e7..000000000 --- a/test/test-automation/tests/testclipboard/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestclipboard.la -libtestclipboard_la_SOURCES = testclipboard.c -libtestclipboard_la_CLAGS = -fPIC -g -libtestclipboard_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testclipboard/testclipboard.c b/test/test-automation/tests/testclipboard/testclipboard.c deleted file mode 100644 index 6fd272b33..000000000 --- a/test/test-automation/tests/testclipboard/testclipboard.c +++ /dev/null @@ -1,168 +0,0 @@ -#include - -#include - -#include "../../include/SDL_test.h" - - -/*! - * Note: Add test for clipboard here - * - */ - -/* Test cases */ -static const TestCaseReference test1 = - (TestCaseReference){ "clipboard_testHasClipboardText", "Check call to SDL_HasClipboardText", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test2 = - (TestCaseReference){ "clipboard_testGetClipboardText", "Check call to SDL_GetClipboardText", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test3 = - (TestCaseReference){ "clipboard_testSetClipboardText", "Check call to SDL_SetClipboardText", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test4 = - (TestCaseReference){ "clipboard_testClipboardTextFunctions", "End-to-end test of SDL_xyzClipboardText functions", TEST_ENABLED, 0, 0 }; - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, &test2, &test3, &test4, NULL -}; - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -void -SetUp(void *arg) -{ - /* Start SDL video */ - int ret = SDL_InitSubSystem( SDL_INIT_VIDEO ); - AssertTrue(ret==0, "SDL_Init(SDL_INIT_VIDEO) failed: %s", SDL_GetError()); -} - -void -TearDown(void *arg) -{ - /* Quit SDL video */ - SDL_QuitSubSystem(SDL_INIT_VIDEO); -} - -/** - * \brief Check call to SDL_HasClipboardText - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_HasClipboardText - */ -int -clipboard_testHasClipboardText(void *arg) -{ - SDL_bool result; - result = SDL_HasClipboardText(); - AssertPass("Call to SDL_HasClipboardText succeeded"); -} - -/** - * \brief Check call to SDL_GetClipboardText - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_GetClipboardText - */ -int -clipboard_testGetClipboardText(void *arg) -{ - char *result; - result = SDL_GetClipboardText(); - AssertPass("Call to SDL_GetClipboardText succeeded"); -} - -/** - * \brief Check call to SDL_SetClipboardText - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_SetClipboardText - */ -int -clipboard_testSetClipboardText(void *arg) -{ - char *textRef = RandomAsciiString(); - char *text = strdup(textRef); - int result; - result = SDL_SetClipboardText((const char *)text); - AssertTrue( - result == 0, - "Call to SDL_SetClipboardText failed with error %i: %s", - result, SDL_GetError()); - AssertTrue( - strcmp(textRef, text) == 0, - "SDL_SetClipboardText modified input string: expected %s, got %s", - textRef, text); - - /* Cleanup */ - if (textRef) free(textRef); - if (text) free(text); -} - - -/** - * \brief End-to-end test of SDL_xyzClipboardText functions - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_HasClipboardText - * http://wiki.libsdl.org/moin.cgi/SDL_GetClipboardText - * http://wiki.libsdl.org/moin.cgi/SDL_SetClipboardText - */ -int -clipboard_testClipboardTextFunctions(void *arg) -{ - char *textRef = RandomAsciiString(); - char *text = strdup(textRef); - SDL_bool boolResult; - int intResult; - char *charResult; - - /* Clear clipboard text state */ - boolResult = SDL_HasClipboardText(); - if (boolResult == SDL_TRUE) { - intResult = SDL_SetClipboardText((const char *)NULL); - AssertTrue( - intResult == 0, - "Call to SDL_SetClipboardText("") failed with error %i: %s", - intResult, SDL_GetError()); - charResult = SDL_GetClipboardText(); - boolResult = SDL_HasClipboardText(); - AssertTrue( - boolResult == SDL_FALSE, - "SDL_HasClipboardText returned TRUE, expected FALSE"); - } - - /* Empty clipboard */ - charResult = SDL_GetClipboardText(); - AssertTrue( - charResult != NULL, - "SDL_GetClipboardText returned NULL"); - AssertTrue( - strlen(charResult) == 0, - "SDL_GetClipboardText returned string with length >0: got length %i", - strlen(charResult)); - intResult = SDL_SetClipboardText((const char *)text); - AssertTrue( - intResult == 0, - "Call to SDL_SetClipboardText failed with error %i: %s", - intResult, SDL_GetError()); - AssertTrue( - strcmp(textRef, text) == 0, - "SDL_SetClipboardText modified input string: expected %s, got %s", - textRef, text); - boolResult = SDL_HasClipboardText(); - AssertTrue( - boolResult == SDL_TRUE, - "SDL_HasClipboardText returned FALSE, expected TRUE"); - charResult = SDL_GetClipboardText(); - AssertTrue( - strcmp(textRef, charResult) == 0, - "SDL_GetClipboardText did not return correst string: expected %s, got %s", - textRef, charResult); - - /* Cleanup */ - if (textRef) free(textRef); - if (text) free(text); - if (charResult) free(charResult); -} diff --git a/test/test-automation/tests/testdummy/Makefile.am b/test/test-automation/tests/testdummy/Makefile.am deleted file mode 100644 index 2f63bf1ec..000000000 --- a/test/test-automation/tests/testdummy/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestdummy.la -libtestdummy_la_SOURCES = testdummy.c -libtestdummy_la_CLAGS = -fPIC -g -libtestdummy_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testdummy/testdummy.c b/test/test-automation/tests/testdummy/testdummy.c deleted file mode 100644 index 6a20626db..000000000 --- a/test/test-automation/tests/testdummy/testdummy.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - Copyright (C) 2011 Markus Kauppila - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as 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 - * Dummy test suite for test runner. This can be used as a base for - * writing new tests. Dummy suite also works as reference to using - * various asserts and other (possible) utilities. - */ - -#include -#include - -#include - -#include "../../include/SDL_test.h" - -#include - -/* Test case references */ -static const TestCaseReference test1 = - (TestCaseReference){ "test_dummy1", "description", TEST_ENABLED, 0, 4}; - -static const TestCaseReference test2 = - (TestCaseReference){ "test_dummy2", "description", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test3 = - (TestCaseReference){ "test_fuzzy", "description", TEST_ENABLED, 0, 2}; - -static const TestCaseReference test4 = - (TestCaseReference){ "test_leak", "description", TEST_ENABLED, 0, 2}; - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, &test2, &test3, &test4, NULL -}; - - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -/* Create test fixture */ - -/*! - * SetUp function can be used to create a test fixture for test cases. - * The function will be called right before executing the test case. - * - * Note: If any assert in the function fails then the test will be skipped. - * In practice, the entire suite will be skipped if assert failure happens. - * - * Note: this function is optional. - * - * \param arg parameters given to test. Usually NULL - */ -void -SetUp(void *arg) -{ - // create test fixture, - // for example, set up static variables used by test cases here -} - -/*! - * TearDown function can be used to destroy a test fixture for test cases. - * The function will be called right after executing the test case. - * - * Note: this function is optional. - * - * \param arg parameters given to test. Usually NULL - */ -void -TearDown(void *arg) -{ - // destroy test fixture -} - -/* Test case functions */ -void -test_dummy1(void *arg) -{ - AssertEquals(5, 5, "Assert message"); - - /* - for( ; 1 ; ) - Log(0, "uint8 (same value): %u", RandomUint32()); - // */ - - //Log(0, "uint8 (same value): %d", RandomUint8BoundaryValue(200, 200, SDL_TRUE)); - - int c = 0; - //for(; c < 100 ; c++) - printf("%f\n", RandomUnitFloat()); - - for(; 0 ; ) - printf("%d\n", RandomSint16()); - - for( ; 0 ; ) { - //Log(0, "sint8: %d", RandomSint8BoundaryValue(-11, 10, SDL_TRUE)); - //Log(0, "sint16: %d", RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE)); - Log(0, "sint32: %d", RandomSint32BoundaryValue(INT_MIN, 3000, SDL_FALSE)); - //Log(0, "sint64: %lld", RandomSint64BoundaryValue(-34, -34, SDL_FALSE)); - } - - for(; 0 ;) { - //Log(0, "int8: %u", RandomUint8BoundaryValue(0, 255, SDL_FALSE)); - //Log(0, "uint16: %u", RandomUint16BoundaryValue(0, UINT16_MAX, SDL_FALSE)); - //Log(0, "int32: %u", RandomUint32BoundaryValue(0, 0xFFFFFFFE, SDL_FALSE)); - Log(0, "int64: %llu", RandomUint64BoundaryValue(2, 0xFFFFFFFFFFFFFFFE, SDL_FALSE)); - } - - for(; 0 ;) { - int min = -5; - int max = 5; - int random = RandomIntegerInRange(min, max); - if(random < min || random > max ) { - AssertFail("Generated incorrect integer"); - } - Log(0, "%d", random); - } - - //Log(0, "Random: %s", RandomAsciiString()); -} - -void -test_dummy2(void *arg) -{ - char *msg = "eello"; - //msg[0] = 'H'; - AssertTrue(1, "Assert message"); - AssertTrue(0, "Assert message"); - AssertTrue(1, "Assert message"); -} - -void -test_fuzzy(void *arg) -{ - // Simulates a fuzzing failure - AssertTrue(RandomUint8() != 100, "Value is 100"); -} - -static void -f(void) { - int* x = malloc(10 * sizeof(int)); - x[10] = 0; // problem 1: heap block overrun -} // problem 2: memory leak -- x not freed - - -void -test_leak(void *arg) -{ - // Creates a memory leak - f(); - - AssertPass(""); -} - diff --git a/test/test-automation/tests/testevents/Makefile.am b/test/test-automation/tests/testevents/Makefile.am deleted file mode 100644 index 3f545ee08..000000000 --- a/test/test-automation/tests/testevents/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestevents.la -libtestevents_la_SOURCES = testevents.c -libtestevents_la_CLAGS = -fPIC -g -libtestevents_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testevents/testevents.c b/test/test-automation/tests/testevents/testevents.c deleted file mode 100644 index bdb7f089d..000000000 --- a/test/test-automation/tests/testevents/testevents.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - -#include "../../include/SDL_test.h" - - - -/*! - * Note: Add test for events here - * - */ - -/* Test cases */ -static const TestCaseReference test1 = - (TestCaseReference){ "events_test", "description", TEST_DISABLED, 0, 0 }; - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, NULL -}; - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -/** - * @brief Document test case here - */ -int -events_test(void *arg) -{ - AssertPass(""); -} diff --git a/test/test-automation/tests/testkeyboard/Makefile.am b/test/test-automation/tests/testkeyboard/Makefile.am deleted file mode 100644 index 4becf49c3..000000000 --- a/test/test-automation/tests/testkeyboard/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestkeyboard.la -libtestkeyboard_la_SOURCES = testkeyboard.c -libtestkeyboard_la_CLAGS = -fPIC -g -libtestkeyboard_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testkeyboard/testkeyboard.c b/test/test-automation/tests/testkeyboard/testkeyboard.c deleted file mode 100644 index 341e39449..000000000 --- a/test/test-automation/tests/testkeyboard/testkeyboard.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - -#include "../../include/SDL_test.h" - - - -/*! - * Note: Add test for keyboard here - * - */ - -/* Test cases */ -static const TestCaseReference test1 = - (TestCaseReference){ "keyboard_test", "description", TEST_DISABLED, 0, 0 }; - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, NULL -}; - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -/** - * @brief Document test case here - */ -int -keyboard_test(void *arg) -{ - AssertPass(""); -} diff --git a/test/test-automation/tests/testplatform/Makefile.am b/test/test-automation/tests/testplatform/Makefile.am deleted file mode 100644 index 0521e7372..000000000 --- a/test/test-automation/tests/testplatform/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestplatform.la -libtestplatform_la_SOURCES = testplatform.c -libtestplatform_la_CLAGS = -fPIC -g -libtestplatform_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testplatform/testplatform.c b/test/test-automation/tests/testplatform/testplatform.c deleted file mode 100644 index 974d6afb7..000000000 --- a/test/test-automation/tests/testplatform/testplatform.c +++ /dev/null @@ -1,508 +0,0 @@ -/** - * Original code: automated SDL platform test written by Edgar Simo "bobbens" - * Extended and updated by aschiffler at ferzkopp dot net - */ - -#include - -#include - -#include "../../include/SDL_test.h" - -/* Test cases */ -static const TestCaseReference test1 = - (TestCaseReference){ "platform_testTypes", "Tests predefined types", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test2 = - (TestCaseReference){ "platform_testEndianessAndSwap", "Tests endianess and swap functions", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test3 = - (TestCaseReference){ "platform_testGetFunctions", "Tests various SDL_GetXYZ functions", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test4 = - (TestCaseReference){ "platform_testHasFunctions", "Tests various SDL_HasXYZ functions", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test5 = - (TestCaseReference){ "platform_testGetVersion", "Tests SDL_GetVersion function", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test6 = - (TestCaseReference){ "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test7 = - (TestCaseReference){ "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test8 = - (TestCaseReference){ "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test9 = - (TestCaseReference){ "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test10 = - (TestCaseReference){ "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test11 = - (TestCaseReference){ "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED, 0, 0 }; - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, &test2, &test3, &test4, &test5, &test6, &test7, &test8, &test9, &test10, &test11, NULL -}; - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -/** - * @brief Compare sizes of types. - * - * @note Watcom C flags these as Warning 201: "Unreachable code" if you just - * compare them directly, so we push it through a function to keep the - * compiler quiet. --ryan. - */ -static int _compareSizeOfType( size_t sizeoftype, size_t hardcodetype ) -{ - return sizeoftype != hardcodetype; -} - -/** - * @brief Tests type sizes. - */ -int platform_testTypes(void *arg) -{ - int ret; - - ret = _compareSizeOfType( sizeof(Uint8), 1 ); - AssertTrue( ret == 0, "sizeof(Uint8) = %lu, expected 1", sizeof(Uint8) ); - - ret = _compareSizeOfType( sizeof(Uint16), 2 ); - AssertTrue( ret == 0, "sizeof(Uint16) = %lu, expected 2", sizeof(Uint16) ); - - ret = _compareSizeOfType( sizeof(Uint32), 4 ); - AssertTrue( ret == 0, "sizeof(Uint32) = %lu, expected 4", sizeof(Uint32) ); - - ret = _compareSizeOfType( sizeof(Uint64), 8 ); - AssertTrue( ret == 0, "sizeof(Uint64) = %lu, expected 8", sizeof(Uint64) ); -} - -/** - * @brief Tests platform endianness and SDL_SwapXY functions. - */ -int platform_testEndianessAndSwap(void *arg) -{ - int real_byteorder; - Uint16 value = 0x1234; - Uint16 value16 = 0xCDAB; - Uint16 swapped16 = 0xABCD; - Uint32 value32 = 0xEFBEADDE; - Uint32 swapped32 = 0xDEADBEEF; - - Uint64 value64, swapped64; - value64 = 0xEFBEADDE; - value64 <<= 32; - value64 |= 0xCDAB3412; - swapped64 = 0x1234ABCD; - swapped64 <<= 32; - swapped64 |= 0xDEADBEEF; - - if ((*((char *) &value) >> 4) == 0x1) { - real_byteorder = SDL_BIG_ENDIAN; - } else { - real_byteorder = SDL_LIL_ENDIAN; - } - - /* Test endianness. */ - AssertTrue( real_byteorder == SDL_BYTEORDER, - "Machine detected as %s endian, appears to be %s endian.", - (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big", - (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big" ); - - /* Test 16 swap. */ - AssertTrue( SDL_Swap16(value16) == swapped16, - "SDL_Swap16(): 16 bit swapped: 0x%X => 0x%X", - value16, SDL_Swap16(value16) ); - - /* Test 32 swap. */ - AssertTrue( SDL_Swap32(value32) == swapped32, - "SDL_Swap32(): 32 bit swapped: 0x%X => 0x%X", - value32, SDL_Swap32(value32) ); - - /* Test 64 swap. */ - AssertTrue( SDL_Swap64(value64) == swapped64, -#ifdef _MSC_VER - "SDL_Swap64(): 64 bit swapped: 0x%I64X => 0x%I64X", -#else - "SDL_Swap64(): 64 bit swapped: 0x%llX => 0x%llX", -#endif - value64, SDL_Swap64(value64) ); -} - -/*! - * \brief Tests SDL_GetXYZ() functions - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_GetPlatform - * http://wiki.libsdl.org/moin.cgi/SDL_GetCPUCount - * http://wiki.libsdl.org/moin.cgi/SDL_GetCPUCacheLineSize - * http://wiki.libsdl.org/moin.cgi/SDL_GetRevision - * http://wiki.libsdl.org/moin.cgi/SDL_GetRevisionNumber - */ -int platform_testGetFunctions (void *arg) -{ - char *platform; - char *revision; - int ret; - int len; - - platform = (char *)SDL_GetPlatform(); - AssertPass("SDL_GetPlatform()"); - AssertTrue(platform != NULL, "SDL_GetPlatform() != NULL"); - if (platform != NULL) { - len = strlen(platform); - AssertTrue(len > 0, - "SDL_GetPlatform(): expected non-empty platform, was platform: '%s', len: %i", - platform, - len); - } - - ret = SDL_GetCPUCount(); - AssertPass("SDL_GetCPUCount()"); - AssertTrue(ret > 0, - "SDL_GetCPUCount(): expected count > 0, was: %i", - ret); - - ret = SDL_GetCPUCacheLineSize(); - AssertPass("SDL_GetCPUCacheLineSize()"); - AssertTrue(ret >= 0, - "SDL_GetCPUCacheLineSize(): expected size >= 0, was: %i", - ret); - - revision = (char *)SDL_GetRevision(); - AssertPass("SDL_GetRevision()"); - AssertTrue(revision != NULL, "SDL_GetRevision() != NULL"); - - ret = SDL_GetRevisionNumber(); - AssertPass("SDL_GetRevisionNumber()"); -} - -/*! - * \brief Tests SDL_HasXYZ() functions - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_Has3DNow - * http://wiki.libsdl.org/moin.cgi/SDL_HasAltiVec - * http://wiki.libsdl.org/moin.cgi/SDL_HasMMX - * http://wiki.libsdl.org/moin.cgi/SDL_HasRDTSC - * http://wiki.libsdl.org/moin.cgi/SDL_HasSSE - * http://wiki.libsdl.org/moin.cgi/SDL_HasSSE2 - * http://wiki.libsdl.org/moin.cgi/SDL_HasSSE3 - * http://wiki.libsdl.org/moin.cgi/SDL_HasSSE41 - * http://wiki.libsdl.org/moin.cgi/SDL_HasSSE42 - */ -int platform_testHasFunctions (void *arg) -{ - int ret; - - // TODO: independently determine and compare values as well - - ret = SDL_HasRDTSC(); - AssertPass("SDL_HasRDTSC()"); - - ret = SDL_HasAltiVec(); - AssertPass("SDL_HasAltiVec()"); - - ret = SDL_HasMMX(); - AssertPass("SDL_HasMMX()"); - - ret = SDL_Has3DNow(); - AssertPass("SDL_Has3DNow()"); - - ret = SDL_HasSSE(); - AssertPass("SDL_HasSSE()"); - - ret = SDL_HasSSE2(); - AssertPass("SDL_HasSSE2()"); - - ret = SDL_HasSSE3(); - AssertPass("SDL_HasSSE3()"); - - ret = SDL_HasSSE41(); - AssertPass("SDL_HasSSE41()"); - - ret = SDL_HasSSE42(); - AssertPass("SDL_HasSSE42()"); -} - -/*! - * \brief Tests SDL_GetVersion - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_GetVersion - */ -int platform_testGetVersion(void *arg) -{ - SDL_version linked; - - SDL_GetVersion(&linked); - AssertTrue( linked.major >= SDL_MAJOR_VERSION, - "SDL_GetVersion(): returned major %i (>= %i)", - linked.major, - SDL_MAJOR_VERSION); - AssertTrue( linked.minor >= SDL_MINOR_VERSION, - "SDL_GetVersion(): returned minor %i (>= %i)", - linked.minor, - SDL_MINOR_VERSION); -} - -/*! - * \brief Tests SDL_VERSION macro - */ -int platform_testSDLVersion(void *arg) -{ - SDL_version compiled; - - SDL_VERSION(&compiled); - AssertTrue( compiled.major >= SDL_MAJOR_VERSION, - "SDL_VERSION() returned major %i (>= %i)", - compiled.major, - SDL_MAJOR_VERSION); - AssertTrue( compiled.minor >= SDL_MINOR_VERSION, - "SDL_VERSION() returned minor %i (>= %i)", - compiled.minor, - SDL_MINOR_VERSION); -} - -/*! - * \brief Tests default SDL_Init - */ -int platform_testDefaultInit(void *arg) -{ - int ret; - int subsystem; - - ret = SDL_Init(0); - AssertTrue( ret == 0, - "SDL_Init(0): returned %i, expected 0, error: %s", - ret, - SDL_GetError()); - - subsystem = SDL_WasInit(0); - AssertTrue( subsystem == 0, - "SDL_WasInit(0): returned %i, expected 0", - ret); - - SDL_Quit(); -} - -/*! - * \brief Tests SDL_Get/Set/ClearError - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_GetError - * http://wiki.libsdl.org/moin.cgi/SDL_SetError - * http://wiki.libsdl.org/moin.cgi/SDL_ClearError - */ -int platform_testGetSetClearError(void *arg) -{ - const char *testError = "Testing"; - char *lastError; - int len; - - SDL_ClearError(); - AssertPass("SDL_ClearError()"); - - lastError = (char *)SDL_GetError(); - AssertPass("SDL_GetError()"); - AssertTrue(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = strlen(lastError); - AssertTrue(len == 0, - "SDL_GetError(): no message expected, len: %i", len); - } - - SDL_SetError("%s", testError); - AssertPass("SDL_SetError()"); - lastError = (char *)SDL_GetError(); - AssertTrue(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = strlen(lastError); - AssertTrue(len == strlen(testError), - "SDL_GetError(): expected message len %i, was len: %i", - strlen(testError), - len); - AssertTrue(strcmp(lastError, testError) == 0, - "SDL_GetError(): expected message %s, was message: %s", - testError, - lastError); - } - - // Clean up - SDL_ClearError(); -} - -/*! - * \brief Tests SDL_SetError with empty input - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_SetError - */ -int platform_testSetErrorEmptyInput(void *arg) -{ - const char *testError = ""; - char *lastError; - int len; - - SDL_SetError("%s", testError); - AssertPass("SDL_SetError()"); - lastError = (char *)SDL_GetError(); - AssertTrue(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = strlen(lastError); - AssertTrue(len == strlen(testError), - "SDL_GetError(): expected message len %i, was len: %i", - strlen(testError), - len); - AssertTrue(strcmp(lastError, testError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - testError, - lastError); - } - - // Clean up - SDL_ClearError(); -} - -/*! - * \brief Tests SDL_SetError with invalid input - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_SetError - */ -int platform_testSetErrorInvalidInput(void *arg) -{ - const char *testError = NULL; - const char *probeError = "Testing"; - char *lastError; - int len; - - // Reset - SDL_ClearError(); - - // Check for no-op - SDL_SetError(testError); - AssertPass("SDL_SetError()"); - lastError = (char *)SDL_GetError(); - AssertTrue(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = strlen(lastError); - AssertTrue(len == 0, - "SDL_GetError(): expected message len 0, was len: %i", - 0, - len); - AssertTrue(strcmp(lastError, "") == 0, - "SDL_GetError(): expected message '', was message: '%s'", - lastError); - } - - // Set - SDL_SetError(probeError); - - // Check for no-op - SDL_SetError(testError); - AssertPass("SDL_SetError()"); - lastError = (char *)SDL_GetError(); - AssertTrue(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = strlen(lastError); - AssertTrue(len == strlen(probeError), - "SDL_GetError(): expected message len %i, was len: %i", - strlen(probeError), - len); - AssertTrue(strcmp(lastError, probeError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - probeError, - lastError); - } - - // Clean up - SDL_ClearError(); -} - -/*! - * \brief Tests SDL_GetPowerInfo - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_GetPowerInfo - */ -int platform_testGetPowerInfo(void *arg) -{ - SDL_PowerState state; - SDL_PowerState stateAgain; - int secs; - int secsAgain; - int pct; - int pctAgain; - - state = SDL_GetPowerInfo(&secs, &pct); - AssertPass("SDL_GetPowerInfo()"); - AssertTrue( - state==SDL_POWERSTATE_UNKNOWN || - state==SDL_POWERSTATE_ON_BATTERY || - state==SDL_POWERSTATE_NO_BATTERY || - state==SDL_POWERSTATE_CHARGING || - state==SDL_POWERSTATE_CHARGED, - "SDL_GetPowerInfo(): state %i is one of the expected values", - (int)state); - - if (state==SDL_POWERSTATE_ON_BATTERY) - { - AssertTrue( - secs >= 0, - "SDL_GetPowerInfo(): on battery, secs >= 0, was: %i", - secs); - AssertTrue( - (pct >= 0) && (pct <= 100), - "SDL_GetPowerInfo(): on battery, pct=[0,100], was: %i", - pct); - } - - if (state==SDL_POWERSTATE_UNKNOWN || - state==SDL_POWERSTATE_NO_BATTERY) - { - AssertTrue( - secs == -1, - "SDL_GetPowerInfo(): no battery, secs == -1, was: %i", - secs); - AssertTrue( - pct == -1, - "SDL_GetPowerInfo(): no battery, pct == -1, was: %i", - pct); - } - - // Partial return value variations - stateAgain = SDL_GetPowerInfo(&secsAgain, NULL); - AssertTrue( - state==stateAgain, - "State %i returned when only 'secs' requested", - stateAgain); - AssertTrue( - secs==secsAgain, - "Value %i matches when only 'secs' requested", - secsAgain); - stateAgain = SDL_GetPowerInfo(NULL, &pctAgain); - AssertTrue( - state==stateAgain, - "State %i returned when only 'pct' requested", - stateAgain); - AssertTrue( - pct==pctAgain, - "Value %i matches when only 'pct' requested", - pctAgain); - stateAgain = SDL_GetPowerInfo(NULL, NULL); - AssertTrue( - state==stateAgain, - "State %i returned when no value requested", - stateAgain); -} diff --git a/test/test-automation/tests/testrect/Makefile.am b/test/test-automation/tests/testrect/Makefile.am deleted file mode 100644 index f45899676..000000000 --- a/test/test-automation/tests/testrect/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestrect.la -libtestrect_la_SOURCES = testrect.c -libtestrect_la_CLAGS = -fPIC -g -libtestrect_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testrect/testrect.c b/test/test-automation/tests/testrect/testrect.c deleted file mode 100644 index 77df61aae..000000000 --- a/test/test-automation/tests/testrect/testrect.c +++ /dev/null @@ -1,1600 +0,0 @@ -/** - * Original code: automated SDL rect test written by Edgar Simo "bobbens" - * New/updated tests: aschiffler at ferzkopp dot net - */ - -#include - -#include - -#include "../../include/SDL_test.h" - -/* SDL_IntersectRectAndLine */ -static const TestCaseReference test1 = - (TestCaseReference){ "rect_testIntersectRectAndLine", "Tests SDL_IntersectRectAndLine clipping cases", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test2 = - (TestCaseReference){ "rect_testIntersectRectAndLineInside", "Tests SDL_IntersectRectAndLine with line fully contained in rect", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test3 = - (TestCaseReference){ "rect_testIntersectRectAndLineOutside", "Tests SDL_IntersectRectAndLine with line fully outside of rect", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test4 = - (TestCaseReference){ "rect_testIntersectRectAndLineEmpty", "Tests SDL_IntersectRectAndLine with empty rectangle ", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test5 = - (TestCaseReference){ "rect_testIntersectRectAndLineParam", "Negative tests against SDL_IntersectRectAndLine with invalid parameters", TEST_ENABLED, 0, 0 }; - -/* SDL_IntersectRect */ -static const TestCaseReference test6 = - (TestCaseReference){ "rect_testIntersectRectInside", "Tests SDL_IntersectRect with B fully contained in A", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test7 = - (TestCaseReference){ "rect_testIntersectRectOutside", "Tests SDL_IntersectRect with B fully outside of A", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test8 = - (TestCaseReference){ "rect_testIntersectRectPartial", "Tests SDL_IntersectRect with B partially intersecting A", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test9 = - (TestCaseReference){ "rect_testIntersectRectPoint", "Tests SDL_IntersectRect with 1x1 sized rectangles", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test10 = - (TestCaseReference){ "rect_testIntersectRectEmpty", "Tests SDL_IntersectRect with empty rectangles", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test11 = - (TestCaseReference){ "rect_testIntersectRectParam", "Negative tests against SDL_IntersectRect with invalid parameters", TEST_ENABLED, 0, 0 }; - -/* SDL_HasIntersection */ -static const TestCaseReference test12 = - (TestCaseReference){ "rect_testHasIntersectionInside", "Tests SDL_HasIntersection with B fully contained in A", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test13 = - (TestCaseReference){ "rect_testHasIntersectionOutside", "Tests SDL_HasIntersection with B fully outside of A", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test14 = - (TestCaseReference){ "rect_testHasIntersectionPartial", "Tests SDL_HasIntersection with B partially intersecting A", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test15 = - (TestCaseReference){ "rect_testHasIntersectionPoint", "Tests SDL_HasIntersection with 1x1 sized rectangles", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test16 = - (TestCaseReference){ "rect_testHasIntersectionEmpty", "Tests SDL_HasIntersection with empty rectangles", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test17 = - (TestCaseReference){ "rect_testHasIntersectionParam", "Negative tests against SDL_HasIntersection with invalid parameters", TEST_ENABLED, 0, 0 }; - -/* SDL_EnclosePoints */ -static const TestCaseReference test18 = - (TestCaseReference){ "rect_testEnclosePoints", "Tests SDL_EnclosePoints without clipping", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test19 = - (TestCaseReference){ "rect_testEnclosePointsWithClipping", "Tests SDL_EnclosePoints with clipping", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test20 = - (TestCaseReference){ "rect_testEnclosePointsRepeatedInput", "Tests SDL_EnclosePoints with repeated input", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test21 = - (TestCaseReference){ "rect_testEnclosePointsParam", "Negative tests against SDL_EnclosePoints with invalid parameters", TEST_ENABLED, 0, 0 }; - -/* SDL_UnionRect */ -static const TestCaseReference test22 = - (TestCaseReference){ "rect_testUnionRectInside", "Tests SDL_UnionRect where rect B is inside rect A", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test23 = - (TestCaseReference){ "rect_testUnionRectOutside", "Tests SDL_UnionRect where rect B is outside rect A", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test24 = - (TestCaseReference){ "rect_testUnionRectEmpty", "Tests SDL_UnionRect where rect A or rect B are empty", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test25 = - (TestCaseReference){ "rect_testUnionRectParam", "Negative tests against SDL_UnionRect with invalid parameters", TEST_ENABLED, 0, 0 }; - -/* SDL_RectEmpty */ -static const TestCaseReference test26 = - (TestCaseReference){ "rect_testRectEmpty", "Tests SDL_RectEmpty with various inputs", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test27 = - (TestCaseReference){ "rect_testRectEmptyParam", "Negative tests against SDL_RectEmpty with invalid parameters", TEST_ENABLED, 0, 0 }; - -/* SDL_RectEquals */ - -static const TestCaseReference test28 = - (TestCaseReference){ "rect_testRectEquals", "Tests SDL_RectEquals with various inputs", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test29 = - (TestCaseReference){ "rect_testRectEqualsParam", "Negative tests against SDL_RectEquals with invalid parameters", TEST_ENABLED, 0, 0 }; - - -/*! - * \brief Test suite for functions that handle simple rectangles including overlaps and merges. - * - * \sa - * http://wiki.libsdl.org/moin.cgi/CategoryRect - */ -extern const TestCaseReference *testSuite[] = { - &test1, &test2, &test3, &test4, &test5, &test6, &test7, &test8, &test9, &test10, &test11, &test12, &test13, &test14, - &test15, &test16, &test17, &test18, &test19, &test20, &test21, &test22, &test23, &test24, &test25, &test26, &test27, - &test28, &test29, NULL -}; - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -/*! - * \brief Private helper to check SDL_IntersectRectAndLine results - */ -void _validateIntersectRectAndLineResults( - SDL_bool intersection, SDL_bool expectedIntersection, - SDL_Rect *rect, SDL_Rect * refRect, - int x1, int y1, int x2, int y2, - int x1Ref, int y1Ref, int x2Ref, int y2Ref) -{ - AssertTrue(intersection == expectedIntersection, - "Incorrect intersection result: expected %s, got %s intersecting rect (%d,%d,%d,%d) with line (%d,%d - %d,%d)\n", - (expectedIntersection == SDL_TRUE) ? "true" : "false", - (intersection == SDL_TRUE) ? "true" : "false", - refRect->x, refRect->y, refRect->w, refRect->h, - x1Ref, y1Ref, x2Ref, y2Ref); - AssertTrue(rect->x == refRect->x && rect->y == refRect->y && rect->w == refRect->w && rect->h == refRect->h, - "Source rectangle was modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rect->x, rect->y, rect->w, rect->h, - refRect->x, refRect->y, refRect->w, refRect->h); - AssertTrue(x1 == x1Ref && y1 == y1Ref && x2 == x2Ref && y2 == y2Ref, - "Line was incorrectly clipped or modified: got (%d,%d - %d,%d) expected (%d,%d - %d,%d)", - x1, y1, x2, y2, - x1Ref, y1Ref, x2Ref, y2Ref); -} - -/*! - * \brief Tests SDL_IntersectRectAndLine() clipping cases - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine - */ -int rect_testIntersectRectAndLine (void *arg) -{ - SDL_Rect refRect = { 0, 0, 32, 32 }; - SDL_Rect rect; - int x1, y1; - int x2, y2; - SDL_bool intersected; - - int xLeft = -RandomIntegerInRange(1, refRect.w); - int xRight = refRect.w + RandomIntegerInRange(1, refRect.w); - int yTop = -RandomIntegerInRange(1, refRect.h); - int yBottom = refRect.h + RandomIntegerInRange(1, refRect.h); - - x1 = xLeft; - y1 = 15; - x2 = xRight; - y2 = 15; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 15, 31, 15); - - x1 = 15; - y1 = yTop; - x2 = 15; - y2 = yBottom; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 15, 0, 15, 31); - - x1 = -refRect.w; - y1 = -refRect.h; - x2 = 2*refRect.w; - y2 = 2*refRect.h; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 0, 31, 31); - - x1 = 2*refRect.w; - y1 = 2*refRect.h; - x2 = -refRect.w; - y2 = -refRect.h; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 31, 31, 0, 0); - - x1 = -1; - y1 = 32; - x2 = 32; - y2 = -1; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 31, 31, 0); - - x1 = 32; - y1 = -1; - x2 = -1; - y2 = 32; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 31, 0, 0, 31); -} - -/*! - * \brief Tests SDL_IntersectRectAndLine() non-clipping case line inside - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine - */ -int rect_testIntersectRectAndLineInside (void *arg) -{ - SDL_Rect refRect = { 0, 0, 32, 32 }; - SDL_Rect rect; - int x1, y1; - int x2, y2; - SDL_bool intersected; - - int xmin = refRect.x; - int xmax = refRect.x + refRect.w - 1; - int ymin = refRect.y; - int ymax = refRect.y + refRect.h - 1; - int x1Ref = RandomIntegerInRange(xmin + 1, xmax - 1); - int y1Ref = RandomIntegerInRange(ymin + 1, ymax - 1); - int x2Ref = RandomIntegerInRange(xmin + 1, xmax - 1); - int y2Ref = RandomIntegerInRange(ymin + 1, ymax - 1); - - x1 = x1Ref; - y1 = y1Ref; - x2 = x2Ref; - y2 = y2Ref; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref); - - x1 = x1Ref; - y1 = y1Ref; - x2 = xmax; - y2 = ymax; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, xmax, ymax); - - x1 = xmin; - y1 = ymin; - x2 = x2Ref; - y2 = y2Ref; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, x2Ref, y2Ref); - - x1 = xmin; - y1 = ymin; - x2 = xmax; - y2 = ymax; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, xmax, ymax); - - x1 = xmin; - y1 = ymax; - x2 = xmax; - y2 = ymin; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymax, xmax, ymin); -} - - -/*! - * \brief Tests SDL_IntersectRectAndLine() non-clipping cases outside - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine - */ -int rect_testIntersectRectAndLineOutside (void *arg) -{ - SDL_Rect refRect = { 0, 0, 32, 32 }; - SDL_Rect rect; - int x1, y1; - int x2, y2; - SDL_bool intersected; - - int xLeft = -RandomIntegerInRange(1, refRect.w); - int xRight = refRect.w + RandomIntegerInRange(1, refRect.w); - int yTop = -RandomIntegerInRange(1, refRect.h); - int yBottom = refRect.h + RandomIntegerInRange(1, refRect.h); - - x1 = xLeft; - y1 = 0; - x2 = xLeft; - y2 = 31; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, xLeft, 0, xLeft, 31); - - x1 = xRight; - y1 = 0; - x2 = xRight; - y2 = 31; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, xRight, 0, xRight, 31); - - x1 = 0; - y1 = yTop; - x2 = 31; - y2 = yTop; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, 0, yTop, 31, yTop); - - x1 = 0; - y1 = yBottom; - x2 = 31; - y2 = yBottom; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, 0, yBottom, 31, yBottom); -} - -/*! - * \brief Tests SDL_IntersectRectAndLine() with empty rectangle - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine - */ -int rect_testIntersectRectAndLineEmpty (void *arg) -{ - SDL_Rect refRect; - SDL_Rect rect; - int x1, y1, x1Ref, y1Ref; - int x2, y2, x2Ref, y2Ref; - SDL_bool intersected; - - refRect.x = RandomIntegerInRange(1, 1024); - refRect.y = RandomIntegerInRange(1, 1024); - refRect.w = 0; - refRect.h = 0; - x1Ref = refRect.x; - y1Ref = refRect.y; - x2Ref = RandomIntegerInRange(1, 1024); - y2Ref = RandomIntegerInRange(1, 1024); - - x1 = x1Ref; - y1 = y1Ref; - x2 = x2Ref; - y2 = y2Ref; - rect = refRect; - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref); -} - -/*! - * \brief Negative tests against SDL_IntersectRectAndLine() with invalid parameters - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine - */ -int rect_testIntersectRectAndLineParam (void *arg) -{ - SDL_Rect rect = { 0, 0, 32, 32 }; - int x1 = rect.w / 2; - int y1 = rect.h / 2; - int x2 = x1; - int y2 = 2 * rect.h; - SDL_bool intersected; - - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - AssertTrue(intersected == SDL_TRUE, "Test variables not intersected as expected"); - - intersected = SDL_IntersectRectAndLine((SDL_Rect *)NULL, &x1, &y1, &x2, &y2); - AssertTrue(intersected == SDL_FALSE, "Incorrect intersected result when 1st parameter is NULL"); - intersected = SDL_IntersectRectAndLine(&rect, (int *)NULL, &y1, &x2, &y2); - AssertTrue(intersected == SDL_FALSE, "Incorrect intersected result when 2nd parameter is NULL"); - intersected = SDL_IntersectRectAndLine(&rect, &x1, (int *)NULL, &x2, &y2); - AssertTrue(intersected == SDL_FALSE, "Incorrect intersected result when 3rd parameter is NULL"); - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, (int *)NULL, &y2); - AssertTrue(intersected == SDL_FALSE, "Incorrect intersected result when 4th parameter is NULL"); - intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, (int *)NULL); - AssertTrue(intersected == SDL_FALSE, "Incorrect intersected result when 5th parameter is NULL"); - intersected = SDL_IntersectRectAndLine((SDL_Rect *)NULL, (int *)NULL, (int *)NULL, (int *)NULL, (int *)NULL); - AssertTrue(intersected == SDL_FALSE, "Incorrect intersected result when all parameters are NULL"); -} - -/*! - * \brief Private helper to check SDL_HasIntersection results - */ -void _validateHasIntersectionResults( - SDL_bool intersection, SDL_bool expectedIntersection, - SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB) -{ - AssertTrue(intersection == expectedIntersection, - "Incorrect intersection result: expected %s, got %s intersecting A (%d,%d,%d,%d) with B (%d,%d,%d,%d)\n", - (expectedIntersection == SDL_TRUE) ? "true" : "false", - (intersection == SDL_TRUE) ? "true" : "false", - rectA->x, rectA->y, rectA->w, rectA->h, - rectB->x, rectB->y, rectB->w, rectB->h); - AssertTrue(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, - "Source rectangle A was modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - refRectA->x, refRectA->y, refRectA->w, refRectA->h); - AssertTrue(rectB->x == refRectB->x && rectB->y == refRectB->y && rectB->w == refRectB->w && rectB->h == refRectB->h, - "Source rectangle B was modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectB->x, rectB->y, rectB->w, rectB->h, - refRectB->x, refRectB->y, refRectB->w, refRectB->h); -} - -/*! - * \brief Private helper to check SDL_IntersectRect results - */ -void _validateIntersectRectResults( - SDL_bool intersection, SDL_bool expectedIntersection, - SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, - SDL_Rect *result, SDL_Rect *expectedResult) -{ - _validateHasIntersectionResults(intersection, expectedIntersection, rectA, rectB, refRectA, refRectB); - if (result && expectedResult) { - AssertTrue(result->x == expectedResult->x && result->y == expectedResult->y && result->w == expectedResult->w && result->h == expectedResult->h, - "Intersection of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was incorrectly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - rectB->x, rectB->y, rectB->w, rectB->h, - result->x, result->y, result->w, result->h, - expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h); - } -} - -/*! - * \brief Private helper to check SDL_UnionRect results - */ -void _validateUnionRectResults( - SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, - SDL_Rect *result, SDL_Rect *expectedResult) -{ - AssertTrue(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, - "Source rectangle A was modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - refRectA->x, refRectA->y, refRectA->w, refRectA->h); - AssertTrue(rectB->x == refRectB->x && rectB->y == refRectB->y && rectB->w == refRectB->w && rectB->h == refRectB->h, - "Source rectangle B was modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectB->x, rectB->y, rectB->w, rectB->h, - refRectB->x, refRectB->y, refRectB->w, refRectB->h); - AssertTrue(result->x == expectedResult->x && result->y == expectedResult->y && result->w == expectedResult->w && result->h == expectedResult->h, - "Union of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was incorrectly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - rectB->x, rectB->y, rectB->w, rectB->h, - result->x, result->y, result->w, result->h, - expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h); -} - -/*! - * \brief Private helper to check SDL_RectEmpty results - */ -void _validateRectEmptyResults( - SDL_bool empty, SDL_bool expectedEmpty, - SDL_Rect *rect, SDL_Rect *refRect) -{ - AssertTrue(empty == expectedEmpty, - "Incorrect empty result: expected %s, got %s testing (%d,%d,%d,%d)\n", - (expectedEmpty == SDL_TRUE) ? "true" : "false", - (empty == SDL_TRUE) ? "true" : "false", - rect->x, rect->y, rect->w, rect->h); - AssertTrue(rect->x == refRect->x && rect->y == refRect->y && rect->w == refRect->w && rect->h == refRect->h, - "Source rectangle was modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rect->x, rect->y, rect->w, rect->h, - refRect->x, refRect->y, refRect->w, refRect->h); -} - -/*! - * \brief Private helper to check SDL_RectEquals results - */ -void _validateRectEqualsResults( - SDL_bool equals, SDL_bool expectedEquals, - SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB) -{ - AssertTrue(equals == expectedEquals, - "Incorrect equals result: expected %s, got %s testing (%d,%d,%d,%d) and (%d,%d,%d,%d) \n", - (expectedEquals == SDL_TRUE) ? "true" : "false", - (equals == SDL_TRUE) ? "true" : "false", - rectA->x, rectA->y, rectA->w, rectA->h, - rectB->x, rectB->y, rectB->w, rectB->h); - AssertTrue(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, - "Source rectangle A was modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - refRectA->x, refRectA->y, refRectA->w, refRectA->h); - AssertTrue(rectB->x == refRectB->x && rectB->y == refRectB->y && rectB->w == refRectB->w && rectB->h == refRectB->h, - "Source rectangle B was modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectB->x, rectB->y, rectB->w, rectB->h, - refRectB->x, refRectB->y, refRectB->w, refRectB->h); -} - -/*! - * \brief Tests SDL_IntersectRect() with B fully inside A - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRect - */ -int rect_testIntersectRectInside (void *arg) -{ - SDL_Rect refRectA = { 0, 0, 32, 32 }; - SDL_Rect refRectB; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_Rect result; - SDL_bool intersection; - - // rectB fully contained in rectA - refRectB.x = 0; - refRectB.y = 0; - refRectB.w = RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); - refRectB.h = RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1); - rectA = refRectA; - rectB = refRectB; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectB); -} - -/*! - * \brief Tests SDL_IntersectRect() with B fully outside A - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRect - */ -int rect_testIntersectRectOutside (void *arg) -{ - SDL_Rect refRectA = { 0, 0, 32, 32 }; - SDL_Rect refRectB; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_Rect result; - SDL_bool intersection; - - // rectB fully outside of rectA - refRectB.x = refRectA.x + refRectA.w + RandomIntegerInRange(1, 10); - refRectB.y = refRectA.y + refRectA.h + RandomIntegerInRange(1, 10); - refRectB.w = refRectA.w; - refRectB.h = refRectA.h; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); -} - -/*! - * \brief Tests SDL_IntersectRect() with B partially intersecting A - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRect - */ -int rect_testIntersectRectPartial (void *arg) -{ - SDL_Rect refRectA = { 0, 0, 32, 32 }; - SDL_Rect refRectB; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_Rect result; - SDL_Rect expectedResult; - SDL_bool intersection; - - // rectB partially contained in rectA - refRectB.x = RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); - refRectB.y = RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1); - refRectB.w = refRectA.w; - refRectB.h = refRectA.h; - rectA = refRectA; - rectB = refRectB; - expectedResult.x = refRectB.x; - expectedResult.y = refRectB.y; - expectedResult.w = refRectA.w - refRectB.x; - expectedResult.h = refRectA.h - refRectB.y; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - - // rectB right edge - refRectB.x = rectA.w - 1; - refRectB.y = rectA.y; - refRectB.w = RandomIntegerInRange(1, refRectA.w - 1); - refRectB.h = RandomIntegerInRange(1, refRectA.h - 1); - rectA = refRectA; - rectB = refRectB; - expectedResult.x = refRectB.x; - expectedResult.y = refRectB.y; - expectedResult.w = 1; - expectedResult.h = refRectB.h; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - - // rectB left edge - refRectB.x = 1 - rectA.w; - refRectB.y = rectA.y; - refRectB.w = refRectA.w; - refRectB.h = RandomIntegerInRange(1, refRectA.h - 1); - rectA = refRectA; - rectB = refRectB; - expectedResult.x = 0; - expectedResult.y = refRectB.y; - expectedResult.w = 1; - expectedResult.h = refRectB.h; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - - // rectB bottom edge - refRectB.x = rectA.x; - refRectB.y = rectA.h - 1; - refRectB.w = RandomIntegerInRange(1, refRectA.w - 1); - refRectB.h = RandomIntegerInRange(1, refRectA.h - 1); - rectA = refRectA; - rectB = refRectB; - expectedResult.x = refRectB.x; - expectedResult.y = refRectB.y; - expectedResult.w = refRectB.w; - expectedResult.h = 1; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - - // rectB top edge - refRectB.x = rectA.x; - refRectB.y = 1 - rectA.h; - refRectB.w = RandomIntegerInRange(1, refRectA.w - 1); - refRectB.h = rectA.h; - rectA = refRectA; - rectB = refRectB; - expectedResult.x = refRectB.x; - expectedResult.y = 0; - expectedResult.w = refRectB.w; - expectedResult.h = 1; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); -} - -/*! - * \brief Tests SDL_IntersectRect() with 1x1 pixel sized rectangles - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRect - */ -int rect_testIntersectRectPoint (void *arg) -{ - SDL_Rect refRectA = { 0, 0, 1, 1 }; - SDL_Rect refRectB = { 0, 0, 1, 1 }; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_Rect result; - SDL_bool intersection; - int offsetX, offsetY; - - // intersecting pixels - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectB.x = refRectA.x; - refRectB.y = refRectA.y; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectA); - - // non-intersecting pixels cases - for (offsetX = -1; offsetX <= 1; offsetX++) { - for (offsetY = -1; offsetY <= 1; offsetY++) { - if (offsetX != 0 || offsetY != 0) { - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectB.x = refRectA.x; - refRectB.y = refRectA.y; - refRectB.x += offsetX; - refRectB.y += offsetY; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - } - } - } -} - -/*! - * \brief Tests SDL_IntersectRect() with empty rectangles - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRect - */ -int rect_testIntersectRectEmpty (void *arg) -{ - SDL_Rect refRectA; - SDL_Rect refRectB; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_Rect result; - SDL_bool intersection; - - // Rect A empty - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectA.w = RandomIntegerInRange(1, 100); - refRectA.h = RandomIntegerInRange(1, 100); - refRectB = refRectA; - refRectA.w = 0; - refRectA.h = 0; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - - // Rect B empty - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectA.w = RandomIntegerInRange(1, 100); - refRectA.h = RandomIntegerInRange(1, 100); - refRectB = refRectA; - refRectB.w = 0; - refRectB.h = 0; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - - // Rect A and B empty - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectA.w = RandomIntegerInRange(1, 100); - refRectA.h = RandomIntegerInRange(1, 100); - refRectB = refRectA; - refRectA.w = 0; - refRectA.h = 0; - refRectB.w = 0; - refRectB.h = 0; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); -} - -/*! - * \brief Negative tests against SDL_IntersectRect() with invalid parameters - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRect - */ -int rect_testIntersectRectParam(void *arg) -{ - SDL_Rect rectA; - SDL_Rect rectB; - SDL_Rect result; - SDL_bool intersection; - - // invalid parameter combinations - intersection = SDL_IntersectRect((SDL_Rect *)NULL, &rectB, &result); - AssertTrue(intersection == SDL_FALSE, "Function did not return false when 1st parameter was NULL"); - intersection = SDL_IntersectRect(&rectA, (SDL_Rect *)NULL, &result); - AssertTrue(intersection == SDL_FALSE, "Function did not return false when 2st parameter was NULL"); - intersection = SDL_IntersectRect(&rectA, &rectB, (SDL_Rect *)NULL); - AssertTrue(intersection == SDL_FALSE, "Function did not return false when 3st parameter was NULL"); - intersection = SDL_IntersectRect((SDL_Rect *)NULL, (SDL_Rect *)NULL, &result); - AssertTrue(intersection == SDL_FALSE, "Function did not return false when 1st and 2nd parameters were NULL"); - intersection = SDL_IntersectRect((SDL_Rect *)NULL, &rectB, (SDL_Rect *)NULL); - AssertTrue(intersection == SDL_FALSE, "Function did not return false when 1st and 3rd parameters were NULL "); - intersection = SDL_IntersectRect((SDL_Rect *)NULL, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - AssertTrue(intersection == SDL_FALSE, "Function did not return false when all parameters were NULL"); -} - -/*! - * \brief Tests SDL_HasIntersection() with B fully inside A - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_HasIntersection - */ -int rect_testHasIntersectionInside (void *arg) -{ - SDL_Rect refRectA = { 0, 0, 32, 32 }; - SDL_Rect refRectB; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_bool intersection; - - // rectB fully contained in rectA - refRectB.x = 0; - refRectB.y = 0; - refRectB.w = RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); - refRectB.h = RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1); - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); -} - -/*! - * \brief Tests SDL_HasIntersection() with B fully outside A - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_HasIntersection - */ -int rect_testHasIntersectionOutside (void *arg) -{ - SDL_Rect refRectA = { 0, 0, 32, 32 }; - SDL_Rect refRectB; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_bool intersection; - - // rectB fully outside of rectA - refRectB.x = refRectA.x + refRectA.w + RandomIntegerInRange(1, 10); - refRectB.y = refRectA.y + refRectA.h + RandomIntegerInRange(1, 10); - refRectB.w = refRectA.w; - refRectB.h = refRectA.h; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); -} - -/*! - * \brief Tests SDL_HasIntersection() with B partially intersecting A - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_HasIntersection - */ -int rect_testHasIntersectionPartial (void *arg) -{ - SDL_Rect refRectA = { 0, 0, 32, 32 }; - SDL_Rect refRectB; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_bool intersection; - - // rectB partially contained in rectA - refRectB.x = RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); - refRectB.y = RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1); - refRectB.w = refRectA.w; - refRectB.h = refRectA.h; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - - // rectB right edge - refRectB.x = rectA.w - 1; - refRectB.y = rectA.y; - refRectB.w = RandomIntegerInRange(1, refRectA.w - 1); - refRectB.h = RandomIntegerInRange(1, refRectA.h - 1); - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - - // rectB left edge - refRectB.x = 1 - rectA.w; - refRectB.y = rectA.y; - refRectB.w = refRectA.w; - refRectB.h = RandomIntegerInRange(1, refRectA.h - 1); - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - - // rectB bottom edge - refRectB.x = rectA.x; - refRectB.y = rectA.h - 1; - refRectB.w = RandomIntegerInRange(1, refRectA.w - 1); - refRectB.h = RandomIntegerInRange(1, refRectA.h - 1); - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - - // rectB top edge - refRectB.x = rectA.x; - refRectB.y = 1 - rectA.h; - refRectB.w = RandomIntegerInRange(1, refRectA.w - 1); - refRectB.h = rectA.h; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); -} - -/*! - * \brief Tests SDL_HasIntersection() with 1x1 pixel sized rectangles - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_HasIntersection - */ -int rect_testHasIntersectionPoint (void *arg) -{ - SDL_Rect refRectA = { 0, 0, 1, 1 }; - SDL_Rect refRectB = { 0, 0, 1, 1 }; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_Rect result; - SDL_bool intersection; - int offsetX, offsetY; - - // intersecting pixels - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectB.x = refRectA.x; - refRectB.y = refRectA.y; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - - // non-intersecting pixels cases - for (offsetX = -1; offsetX <= 1; offsetX++) { - for (offsetY = -1; offsetY <= 1; offsetY++) { - if (offsetX != 0 || offsetY != 0) { - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectB.x = refRectA.x; - refRectB.y = refRectA.y; - refRectB.x += offsetX; - refRectB.y += offsetY; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); - } - } - } -} - -/*! - * \brief Tests SDL_HasIntersection() with empty rectangles - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_HasIntersection - */ -int rect_testHasIntersectionEmpty (void *arg) -{ - SDL_Rect refRectA; - SDL_Rect refRectB; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_bool intersection; - - // Rect A empty - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectA.w = RandomIntegerInRange(1, 100); - refRectA.h = RandomIntegerInRange(1, 100); - refRectB = refRectA; - refRectA.w = 0; - refRectA.h = 0; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); - - // Rect B empty - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectA.w = RandomIntegerInRange(1, 100); - refRectA.h = RandomIntegerInRange(1, 100); - refRectB = refRectA; - refRectB.w = 0; - refRectB.h = 0; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); - - // Rect A and B empty - refRectA.x = RandomIntegerInRange(1, 100); - refRectA.y = RandomIntegerInRange(1, 100); - refRectA.w = RandomIntegerInRange(1, 100); - refRectA.h = RandomIntegerInRange(1, 100); - refRectB = refRectA; - refRectA.w = 0; - refRectA.h = 0; - refRectB.w = 0; - refRectB.h = 0; - rectA = refRectA; - rectB = refRectB; - intersection = SDL_HasIntersection(&rectA, &rectB); - _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); -} - -/*! - * \brief Negative tests against SDL_HasIntersection() with invalid parameters - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_HasIntersection - */ -int rect_testHasIntersectionParam(void *arg) -{ - SDL_Rect rectA; - SDL_Rect rectB; - SDL_bool intersection; - - // invalid parameter combinations - intersection = SDL_HasIntersection((SDL_Rect *)NULL, &rectB); - AssertTrue(intersection == SDL_FALSE, "Function did not return false when 1st parameter was NULL"); - intersection = SDL_HasIntersection(&rectA, (SDL_Rect *)NULL); - AssertTrue(intersection == SDL_FALSE, "Function did not return false when 2st parameter was NULL"); - intersection = SDL_HasIntersection((SDL_Rect *)NULL, (SDL_Rect *)NULL); - AssertTrue(intersection == SDL_FALSE, "Function did not return false when all parameters were NULL"); -} - -/*! - * \brief Test SDL_EnclosePoints() without clipping - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_EnclosePoints - */ -int rect_testEnclosePoints(void *arg) -{ - const int numPoints = 16; - SDL_Point refPoints[numPoints]; - SDL_Point points[numPoints]; - int count; - SDL_Rect result; - SDL_bool anyEnclosed; - SDL_bool anyEnclosedNoResult; - - // Create input data, tracking result - SDL_bool expectedEnclosed = SDL_TRUE; - int newx, newy; - int minx, maxx, miny, maxy; - int i; - for (i=0; imaxx) maxx=newx; - if (newymaxy) maxy=newy; - } - } - - // Call function and validate - special case: no result requested - anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, (SDL_Rect *)NULL); - AssertTrue(expectedEnclosed==anyEnclosedNoResult, - "Expected return value %s, got %s", - (expectedEnclosed==SDL_TRUE) ? "true" : "false", (anyEnclosedNoResult==SDL_TRUE) ? "true" : "false"); - for (i=0; imaxx) maxx=newx; - if (newymaxy) maxy=newy; - } - } - - // Call function and validate - special case: no result requested - anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, (SDL_Rect *)NULL); - AssertTrue(expectedEnclosed==anyEnclosedNoResult, - "Expected return value %s, got %s", - (expectedEnclosed==SDL_TRUE) ? "true" : "false", (anyEnclosedNoResult==SDL_TRUE) ? "true" : "false"); - for (i=0; i=refClip.x) && (newx<(refClip.x + refClip.w)) && - (newy>=refClip.y) && (newy<(refClip.y + refClip.h))) { - if (expectedEnclosed==SDL_FALSE) { - minx=maxx=newx; - miny=maxy=newy; - } else { - if (newxmaxx) maxx=newx; - if (newymaxy) maxy=newy; - } - expectedEnclosed = SDL_TRUE; - } - } - - // Call function and validate - special case: no result requested - clip = refClip; - anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)&clip, (SDL_Rect *)NULL); - AssertTrue(expectedEnclosed==anyEnclosedNoResult, - "Expected return value %s, got %s", - (expectedEnclosed==SDL_TRUE) ? "true" : "false", (anyEnclosedNoResult==SDL_TRUE) ? "true" : "false"); - for (i=0; irefRectB.x) ? refRectA.x : refRectB.x; - miny = (refRectA.yrefRectB.y) ? refRectA.y : refRectB.y; - expectedResult.x = minx; - expectedResult.y = miny; - expectedResult.w = maxx - minx + 1; - expectedResult.h = maxy - miny + 1; - rectA = refRectA; - rectB = refRectB; - SDL_UnionRect(&rectA, &rectB, &result); - _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - } - } - } - - /* Union outside overlap */ - for (dx = -1; dx < 2; dx++) { - for (dy = -1; dy < 2; dy++) { - if ((dx != 0) || (dy != 0)) { - refRectA.x=RandomIntegerInRange(-1024, 1024); - refRectA.y=RandomIntegerInRange(-1024, 1024); - refRectA.w=RandomIntegerInRange(256, 512); - refRectA.h=RandomIntegerInRange(256, 512); - refRectB.x=refRectA.x + 1 + dx*2; - refRectB.y=refRectA.y + 1 + dy*2; - refRectB.w=refRectA.w - 2; - refRectB.h=refRectA.h - 2; - expectedResult = refRectA; - if (dx == -1) expectedResult.x--; - if (dy == -1) expectedResult.y--; - if ((dx == 1) || (dx == -1)) expectedResult.w++; - if ((dy == 1) || (dy == -1)) expectedResult.h++; - rectA = refRectA; - rectB = refRectB; - SDL_UnionRect(&rectA, &rectB, &result); - _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - } - } - } -} - -/*! - * \brief Tests SDL_UnionRect() where rect A or rect B are empty - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_UnionRect - */ -int rect_testUnionRectEmpty(void *arg) -{ - SDL_Rect refRectA, refRectB; - SDL_Rect rectA, rectB; - SDL_Rect expectedResult; - SDL_Rect result; - - /* A empty */ - refRectA.x=RandomIntegerInRange(-1024, 1024); - refRectA.y=RandomIntegerInRange(-1024, 1024); - refRectA.w=0; - refRectA.h=0; - refRectB.x=RandomIntegerInRange(-1024, 1024); - refRectB.y=RandomIntegerInRange(-1024, 1024); - refRectB.w=RandomIntegerInRange(1, 1024); - refRectB.h=RandomIntegerInRange(1, 1024); - expectedResult = refRectB; - rectA = refRectA; - rectB = refRectB; - SDL_UnionRect(&rectA, &rectB, &result); - _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - - /* B empty */ - refRectA.x=RandomIntegerInRange(-1024, 1024); - refRectA.y=RandomIntegerInRange(-1024, 1024); - refRectA.w=RandomIntegerInRange(1, 1024); - refRectA.h=RandomIntegerInRange(1, 1024); - refRectB.x=RandomIntegerInRange(-1024, 1024); - refRectB.y=RandomIntegerInRange(-1024, 1024); - refRectB.w=0; - refRectB.h=0; - expectedResult = refRectA; - rectA = refRectA; - rectB = refRectB; - SDL_UnionRect(&rectA, &rectB, &result); - _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - - /* A and B empty */ - refRectA.x=RandomIntegerInRange(-1024, 1024); - refRectA.y=RandomIntegerInRange(-1024, 1024); - refRectA.w=0; - refRectA.h=0; - refRectB.x=RandomIntegerInRange(-1024, 1024); - refRectB.y=RandomIntegerInRange(-1024, 1024); - refRectB.w=0; - refRectB.h=0; - result.x=0; - result.y=0; - result.w=0; - result.h=0; - expectedResult = result; - rectA = refRectA; - rectB = refRectB; - SDL_UnionRect(&rectA, &rectB, &result); - _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); -} - -/*! - * \brief Tests SDL_UnionRect() where rect B is inside rect A - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_UnionRect - */ -int rect_testUnionRectInside(void *arg) -{ - SDL_Rect refRectA, refRectB; - SDL_Rect rectA, rectB; - SDL_Rect expectedResult; - SDL_Rect result; - int minx, maxx, miny, maxy; - int dx, dy; - - /* Union 1x1 with itself */ - refRectA.x=RandomIntegerInRange(-1024, 1024); - refRectA.y=RandomIntegerInRange(-1024, 1024); - refRectA.w=1; - refRectA.h=1; - expectedResult = refRectA; - rectA = refRectA; - SDL_UnionRect(&rectA, &rectA, &result); - _validateUnionRectResults(&rectA, &rectA, &refRectA, &refRectA, &result, &expectedResult); - - /* Union 1x1 somewhere inside */ - refRectA.x=RandomIntegerInRange(-1024, 1024); - refRectA.y=RandomIntegerInRange(-1024, 1024); - refRectA.w=RandomIntegerInRange(256, 1024); - refRectA.h=RandomIntegerInRange(256, 1024); - refRectB.x=refRectA.x + 1 + RandomIntegerInRange(1, refRectA.w - 2); - refRectB.y=refRectA.y + 1 + RandomIntegerInRange(1, refRectA.h - 2); - refRectB.w=1; - refRectB.h=1; - expectedResult = refRectA; - rectA = refRectA; - rectB = refRectB; - SDL_UnionRect(&rectA, &rectB, &result); - _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - - /* Union inside with edges modified */ - for (dx = -1; dx < 2; dx++) { - for (dy = -1; dy < 2; dy++) { - if ((dx != 0) || (dy != 0)) { - refRectA.x=RandomIntegerInRange(-1024, 1024); - refRectA.y=RandomIntegerInRange(-1024, 1024); - refRectA.w=RandomIntegerInRange(256, 1024); - refRectA.h=RandomIntegerInRange(256, 1024); - refRectB = refRectA; - if (dx == -1) refRectB.x++; - if ((dx == 1) || (dx == -1)) refRectB.w--; - if (dy == -1) refRectB.y++; - if ((dy == 1) || (dy == -1)) refRectB.h--; - expectedResult = refRectA; - rectA = refRectA; - rectB = refRectB; - SDL_UnionRect(&rectA, &rectB, &result); - _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - } - } - } -} - -/*! - * \brief Negative tests against SDL_UnionRect() with invalid parameters - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_UnionRect - */ -int rect_testUnionRectParam(void *arg) -{ - SDL_Rect rectA, rectB; - SDL_Rect result; - - // invalid parameter combinations - SDL_UnionRect((SDL_Rect *)NULL, &rectB, &result); - AssertPass("Function did return when 1st parameter was NULL"); - SDL_UnionRect(&rectA, (SDL_Rect *)NULL, &result); - AssertPass("Function did return when 2nd parameter was NULL"); - SDL_UnionRect(&rectA, &rectB, (SDL_Rect *)NULL); - AssertPass("Function did return when 3rd parameter was NULL"); - SDL_UnionRect((SDL_Rect *)NULL, &rectB, (SDL_Rect *)NULL); - AssertPass("Function did return when 1st and 3rd parameter were NULL"); - SDL_UnionRect(&rectA, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - AssertPass("Function did return when 2nd and 3rd parameter were NULL"); - SDL_UnionRect((SDL_Rect *)NULL, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - AssertPass("Function did return when all parameters were NULL"); -} - -/*! - * \brief Tests SDL_RectEmpty() with various inputs - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_RectEmpty - */ -int rect_testRectEmpty(void *arg) -{ - SDL_Rect refRect; - SDL_Rect rect; - SDL_bool expectedResult; - SDL_bool result; - int w, h; - - // Non-empty case - refRect.x=RandomIntegerInRange(-1024, 1024); - refRect.y=RandomIntegerInRange(-1024, 1024); - refRect.w=RandomIntegerInRange(256, 1024); - refRect.h=RandomIntegerInRange(256, 1024); - expectedResult = SDL_FALSE; - rect = refRect; - result = SDL_RectEmpty((const SDL_Rect *)&rect); - _validateRectEmptyResults(result, expectedResult, &rect, &refRect); - - // Empty case - for (w=-1; w<2; w++) { - for (h=-1; h<2; h++) { - if ((w != 1) || (h != 1)) { - refRect.x=RandomIntegerInRange(-1024, 1024); - refRect.y=RandomIntegerInRange(-1024, 1024); - refRect.w=w; - refRect.h=h; - expectedResult = SDL_TRUE; - rect = refRect; - result = SDL_RectEmpty((const SDL_Rect *)&rect); - _validateRectEmptyResults(result, expectedResult, &rect, &refRect); - } - } - } -} - -/*! - * \brief Negative tests against SDL_RectEmpty() with invalid parameters - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_RectEmpty - */ -int rect_testRectEmptyParam(void *arg) -{ - SDL_bool result; - - // invalid parameter combinations - result = SDL_RectEmpty((const SDL_Rect *)NULL); - AssertTrue(result == SDL_TRUE, "Function did not return TRUE when 1st parameter was NULL"); -} - -/*! - * \brief Tests SDL_RectEquals() with various inputs - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_RectEquals - */ -int rect_testRectEquals(void *arg) -{ - SDL_Rect refRectA; - SDL_Rect refRectB; - SDL_Rect rectA; - SDL_Rect rectB; - SDL_bool expectedResult; - SDL_bool result; - - // Equals - refRectA.x=RandomIntegerInRange(-1024, 1024); - refRectA.y=RandomIntegerInRange(-1024, 1024); - refRectA.w=RandomIntegerInRange(1, 1024); - refRectA.h=RandomIntegerInRange(1, 1024); - refRectB = refRectA; - expectedResult = SDL_TRUE; - rectA = refRectA; - rectB = refRectB; - result = SDL_RectEquals((const SDL_Rect *)&rectA, (const SDL_Rect *)&rectB); - _validateRectEqualsResults(result, expectedResult, &rectA, &rectB, &refRectA, &refRectB); -} - -/*! - * \brief Negative tests against SDL_RectEquals() with invalid parameters - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_RectEquals - */ -int rect_testRectEqualsParam(void *arg) -{ - SDL_Rect rectA; - SDL_Rect rectB; - SDL_bool result; - - /* data setup */ - rectA.x=RandomIntegerInRange(-1024, 1024); - rectA.y=RandomIntegerInRange(-1024, 1024); - rectA.w=RandomIntegerInRange(1, 1024); - rectA.h=RandomIntegerInRange(1, 1024); - rectB.x=RandomIntegerInRange(-1024, 1024); - rectB.y=RandomIntegerInRange(-1024, 1024); - rectB.w=RandomIntegerInRange(1, 1024); - rectB.h=RandomIntegerInRange(1, 1024); - - // invalid parameter combinations - result = SDL_RectEquals((const SDL_Rect *)NULL, (const SDL_Rect *)&rectB); - AssertTrue(result == SDL_FALSE, "Function did not return FALSE when 1st parameter was NULL"); - result = SDL_RectEquals((const SDL_Rect *)&rectA, (const SDL_Rect *)NULL); - AssertTrue(result == SDL_FALSE, "Function did not return FALSE when 2nd parameter was NULL"); - result = SDL_RectEquals((const SDL_Rect *)NULL, (const SDL_Rect *)NULL); - AssertTrue(result == SDL_FALSE, "Function did not return FALSE when 1st and 2nd parameter were NULL"); -} diff --git a/test/test-automation/tests/testrender/Makefile.am b/test/test-automation/tests/testrender/Makefile.am deleted file mode 100644 index 314322192..000000000 --- a/test/test-automation/tests/testrender/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestrender.la -libtestrender_la_SOURCES = testrender.c -libtestrender_la_CLAGS = -fPIC -g -libtestrender_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testrender/testrender.c b/test/test-automation/tests/testrender/testrender.c deleted file mode 100644 index bea2040d5..000000000 --- a/test/test-automation/tests/testrender/testrender.c +++ /dev/null @@ -1,925 +0,0 @@ -/** - * Original code: automated SDL platform test written by Edgar Simo "bobbens" - * Extended and updated by aschiffler at ferzkopp dot net - */ - -#include - -#include - -#include "../../include/SDL_test.h" - -#define SCREEN_W 80 -#define SCREEN_H 60 - -#define FACE_W img_face.width -#define FACE_H img_face.height - -static SDL_Renderer *renderer; - -/* Prototypes for helper functions */ -static int _clearScreen (void); -static void _compare(const char *msg, const SurfaceImage_t *s, int allowable_error); -static int _hasTexAlpha(void); -static int _hasTexColor(void); -static SDL_Texture *_loadTestFace(void); -static int _hasBlendModes(void); -static int _hasDrawColor(void); -static int _isSupported(int code); - - -/* Test cases */ -static const TestCaseReference test1 = - (TestCaseReference){ "render_testGetNumRenderDrivers", "Tests call to SDL_GetNumRenderDrivers", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test2 = - (TestCaseReference){ "render_testCreateRenderer", "Tests SDL_CreateRenderer", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test3 = - (TestCaseReference){ "render_testPrimitives", "Tests rendering primitives", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test4 = - (TestCaseReference){ "render_testPrimitivesBlend", "Tests rendering primitives with blending", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test5 = - (TestCaseReference){ "render_testBlit", "Tests blitting", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test6 = - (TestCaseReference){ "render_testBlitColour", "Tests blitting with color", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test7 = - (TestCaseReference){ "render_testBlitAlpha", "Tests blitting with alpha", TEST_ENABLED, 0, 0 }; - -static const TestCaseReference test8 = - (TestCaseReference){ "render_testBlitBlend", "Tests blitting with blending", TEST_ENABLED, 0, 0 }; - - - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, &test2, &test3, &test4, &test5, &test6, &test7, &test8, NULL -}; - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -// Fixture - -void -SetUp(void *arg) -{ - /* Start SDL. */ - int ret = SDL_InitSubSystem( SDL_INIT_VIDEO ); - AssertTrue(ret==0, "SDL_Init(SDL_INIT_VIDEO): %s", SDL_GetError()); - - SDL_Window *w = SDL_CreateWindow( "title", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - 80, 60, SDL_WINDOW_SHOWN ); - renderer = SDL_CreateRenderer(w, 0, 0); -} - -void -TearDown(void *arg) -{ - /* Quit SDL video */ - SDL_QuitSubSystem(SDL_INIT_VIDEO); -} - -/** - * @brief Tests call to SDL_GetNumRenderDrivers - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_GetNumRenderDrivers - */ -int -render_testGetNumRenderDrivers(void *arg) -{ - int n; - n = SDL_GetNumRenderDrivers(); - AssertTrue(n>=1, "Number of renderers >= 1, reported as %i", n); - if (n<0) { - AssertFail("SDL_GetNumRenderDrivers() failed: %s", SDL_GetError()); - } -} - -/** - * @brief Tests call to SDL_CreateRenderer - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_CreateRenderer - */ -int -render_testCreateRenderer(void *arg) -{ - SDL_Window *window = NULL; - SDL_Renderer *renderer = NULL; - int posX = 100, posY = 100, width = 320, height = 240; - window = SDL_CreateWindow("Hello World", posX, posY, width, height, 0); - if (window != NULL) { - AssertPass("Window created"); - renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE); - if (renderer) { - AssertPass("Renderer created"); - SDL_DestroyRenderer(renderer); - } else { - AssertFail("Could not create renderer: %s", SDL_GetError()); - } - SDL_DestroyWindow(window); - } else { - AssertFail("Could not create window: %s", SDL_GetError()); - } -} - - - - -/** - * @brief Tests the SDL primitives for rendering. - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor - * http://wiki.libsdl.org/moin.cgi/SDL_RenderFillRect - * http://wiki.libsdl.org/moin.cgi/SDL_RenderDrawLine - * - */ -int render_testPrimitives (void *arg) -{ - int ret; - int x, y; - SDL_Rect rect; - - /* Need drawcolour or just skip test. */ - AssertTrue(_hasDrawColor(), "hasDrawColor"); - - /* Draw a rectangle. */ - rect.x = 40; - rect.y = 0; - rect.w = 40; - rect.h = 80; - - ret = SDL_SetRenderDrawColor(renderer, 13, 73, 200, SDL_ALPHA_OPAQUE ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor"); - - ret = SDL_RenderFillRect(renderer, &rect ); - AssertEquals(ret, 0,"SDL_RenderFillRect"); - - /* Draw a rectangle. */ - rect.x = 10; - rect.y = 10; - rect.w = 60; - rect.h = 40; - ret = SDL_SetRenderDrawColor(renderer, 200, 0, 100, SDL_ALPHA_OPAQUE ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor"); - - ret = SDL_RenderFillRect(renderer, &rect ); - AssertEquals(ret, 0, "SDL_RenderFillRect"); - - /* Draw some points like so: - * X.X.X.X.. - * .X.X.X.X. - * X.X.X.X.. */ - for (y=0; y<3; y++) { - x = y % 2; - for (; x<80; x+=2) { - ret = SDL_SetRenderDrawColor(renderer, x*y, x*y/2, x*y/3, SDL_ALPHA_OPAQUE ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor"); - - ret = SDL_RenderDrawPoint(renderer, x, y ); - AssertEquals(ret, 0, "SDL_RenderDrawPoint"); - } - } - - /* Draw some lines. */ - ret = SDL_SetRenderDrawColor(renderer, 0, 255, 0, SDL_ALPHA_OPAQUE ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor"); - - ret = SDL_RenderDrawLine(renderer, 0, 30, 80, 30 ); - AssertEquals(ret, 0, "SDL_RenderDrawLine"); - - ret = SDL_SetRenderDrawColor(renderer, 55, 55, 5, SDL_ALPHA_OPAQUE ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor"); - - ret = SDL_RenderDrawLine(renderer, 40, 30, 40, 60 ); - AssertEquals(ret, 0, "SDL_RenderDrawLine"); - - ret = SDL_SetRenderDrawColor(renderer, 5, 105, 105, SDL_ALPHA_OPAQUE ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor"); - - ret = SDL_RenderDrawLine(renderer, 0, 0, 29, 29 ); - AssertEquals(ret, 0, "SDL_RenderDrawLine"); - - ret = SDL_RenderDrawLine(renderer, 29, 30, 0, 59 ); - AssertEquals(ret, 0, "SDL_RenderDrawLine"); - - ret = SDL_RenderDrawLine(renderer, 79, 0, 50, 29 ); - AssertEquals(ret, 0, "SDL_RenderDrawLine"); - - ret = SDL_RenderDrawLine(renderer, 79, 59, 50, 30 ); - AssertEquals(ret, 0, "SDL_RenderDrawLine"); - - /* See if it's the same. */ - _compare( "Primitives output not the same.", &img_primitives, ALLOWABLE_ERROR_OPAQUE ); -} - - -/** - * @brief Tests the SDL primitives with alpha for rendering. - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor - * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawBlendMode - * http://wiki.libsdl.org/moin.cgi/SDL_RenderFillRect - */ -int render_testPrimitivesBlend (void *arg) -{ - int ret; - int i, j; - SDL_Rect rect; - - /* Need drawcolour and blendmode or just skip test. */ - AssertTrue(_hasDrawColor(), "_hasDrawColor"); - AssertTrue(_hasBlendModes(), "_hasBlendModes"); - - /* Create some rectangles for each blend mode. */ - ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, 0 ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor" ); - - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); - AssertEquals(ret, 0, "SDL_SetRenderDrawBlendMode" ); - - ret = SDL_RenderFillRect(renderer, NULL ); - AssertEquals(ret, 0, "SDL_RenderFillRect" ); - - rect.x = 10; - rect.y = 25; - rect.w = 40; - rect.h = 25; - ret = SDL_SetRenderDrawColor(renderer, 240, 10, 10, 75 ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor" ); - - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD ); - AssertEquals(ret, 0, "SDL_SetRenderDrawBlendMode" ); - - ret = SDL_RenderFillRect(renderer, &rect ); - AssertEquals(ret, 0, "SDL_RenderFillRect" ); - - rect.x = 30; - rect.y = 40; - rect.w = 45; - rect.h = 15; - ret = SDL_SetRenderDrawColor(renderer, 10, 240, 10, 100 ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor" ); - - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND ); - AssertEquals(ret, 0, "SDL_SetRenderDrawBlendMode" ); - - ret = SDL_RenderFillRect(renderer, &rect ); - AssertEquals(ret, 0, "SDL_RenderFillRect" ); - - rect.x = 25; - rect.y = 25; - rect.w = 25; - rect.h = 25; - ret = SDL_SetRenderDrawColor(renderer, 10, 10, 240, 125 ); - AssertEquals(ret, 0, "SDL_SetRenderDrawColor" ); - - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); - AssertEquals(ret, 0, "SDL_SetRenderDrawBlendMode" ); - - ret = SDL_RenderFillRect(renderer, &rect ); - AssertEquals(ret, 0, "SDL_RenderFillRect" ); - - - /* Draw blended lines, lines for everyone. */ - for (i=0; i -#include - -FILE* TestSupportRWops_OpenFPFromReadDir(const char *file, const char *mode); -FILE* TestSupportRWops_OpenFPFromWriteDir(const char *file, const char *mode); -SDL_RWops* TestSupportRWops_OpenRWopsFromReadDir(const char *file, const char *mode); -SDL_RWops* TestSupportRWops_OpenRWopsFromWriteDir(const char *file, const char *mode); - -#endif diff --git a/test/test-automation/tests/testrwops/read b/test/test-automation/tests/testrwops/read deleted file mode 100644 index c57eff55e..000000000 --- a/test/test-automation/tests/testrwops/read +++ /dev/null @@ -1 +0,0 @@ -Hello World! \ No newline at end of file diff --git a/test/test-automation/tests/testrwops/testrwops.c b/test/test-automation/tests/testrwops/testrwops.c deleted file mode 100644 index 8e0c4bcd8..000000000 --- a/test/test-automation/tests/testrwops/testrwops.c +++ /dev/null @@ -1,284 +0,0 @@ -/** - * Automated SDL_RWops test. - * - * Original code written by Edgar Simo "bobbens" - * Ported by Markus Kauppila (markus.kauppila@gmail.com) - * - * Released under Public Domain. - */ - -#include - -#include - -#include "../../include/SDL_test.h" - -const char* RWOPS_READ = "rwops_read"; -const char* RWOPS_WRITE = "rwops_write"; - -static const char hello_world[] = "Hello World!"; -static const char const_mem[] = "Hello World!"; - - -/* Test cases */ -static const TestCaseReference test1 = - (TestCaseReference){ "rwops_testParam", " Negative test for SDL_RWFromFile parameters", TEST_ENABLED, 0, 60 }; - -static const TestCaseReference test2 = - (TestCaseReference){ "rwops_testMem", "Tests opening from memory", TEST_ENABLED, 0, 60 }; - -static const TestCaseReference test3 = - (TestCaseReference){ "rwops_testConstMem", "Tests opening from (const) memory", TEST_ENABLED, 0, 60 }; - -static const TestCaseReference test4 = - (TestCaseReference){ "rwops_testFileRead", "Tests reading from a file", TEST_ENABLED, 0, 60 }; - -static const TestCaseReference test5 = - (TestCaseReference){ "rwops_testFileWrite", "Test writing to a file", TEST_ENABLED, 0, 60 }; - -static const TestCaseReference test6 = - (TestCaseReference){ "rwops_testFPRead", "Test reading from stdio", TEST_ENABLED, TEST_REQUIRES_STDIO, 60 }; - -static const TestCaseReference test7 = - (TestCaseReference){ "rwops_testFPWrite", "Test writing to stdio", TEST_ENABLED, TEST_REQUIRES_STDIO, 60 }; - - - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, &test2, &test3, &test4, &test5, &test6, &test7, NULL -}; - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - - -// Fixture -void -SetUp(void *arg) -{ - FILE *handle = fopen(RWOPS_READ, "w"); - AssertTrue(handle != NULL, "Creating file '%s' failed", RWOPS_READ); - - fwrite(hello_world, 1, SDL_strlen(hello_world), handle); - fclose(handle); -} - -void -TearDown(void *arg) -{ - // Remove the created files - remove(RWOPS_READ); - remove(RWOPS_WRITE); -} - -/** - * @brief Makes sure parameters work properly. Helper function - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_RWseek - * http://wiki.libsdl.org/moin.cgi/SDL_RWread - */ -int _testGeneric( SDL_RWops *rw, int write ) -{ - char buf[sizeof(hello_world)]; - int i; - - /* Set to start. */ - i = SDL_RWseek( rw, 0, RW_SEEK_SET ); - AssertEquals(i, 0, "Seeking with SDL_RWseek (RW_SEEK_SET)"); - - /* Test write. */ - i = SDL_RWwrite( rw, hello_world, sizeof(hello_world)-1, 1); - - if (write) { - AssertEquals(i, 1, "Writing with SDL_RWwrite (failed to write)"); - } - else { - AssertTrue(i <= 0, "Writing with SDL_RWwrite (wrote when shouldn't have): %d <= 0", i); - } - - /* Test seek. */ - i = SDL_RWseek( rw, 6, RW_SEEK_SET ); - - AssertEquals(i, 6, "Seeking with SDL_RWseek (RW_SEEK_SET)"); - - /* Test seek. */ - i = SDL_RWseek( rw, 0, RW_SEEK_SET ); - AssertEquals(i, 0, "Seeking with SDL_RWseek (RW_SEEK_SET)"); - - /* Test read. */ - i = SDL_RWread( rw, buf, 1, sizeof(hello_world)-1 ); - AssertEquals(i, sizeof(hello_world)-1, "Reading with SDL_RWread"); - AssertEquals(SDL_memcmp( buf, hello_world, sizeof(hello_world)-1 ), 0, "Memory read does not match memory written"); - - /* More seek tests. */ - i = SDL_RWseek( rw, -4, RW_SEEK_CUR ); - AssertEquals(i, sizeof(hello_world)-5, "Seeking with SDL_RWseek (RW_SEEK_CUR))"); - - i = SDL_RWseek( rw, -1, RW_SEEK_END ); - AssertEquals(i, sizeof(hello_world)-2, "Seeking with SDL_RWseek (RW_SEEK_END)"); -} - -/*! - * Negative test for SDL_RWFromFile parameters - * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_RWFromFile - * - */ -void rwops_testParam (void) -{ - SDL_RWops *rwops; - - /* These should all fail. */ - rwops = SDL_RWFromFile(NULL, NULL); - AssertTrue(rwops == NULL, "SDL_RWFromFile(NULL, NULL) worked"); - - rwops = SDL_RWFromFile(NULL, "ab+"); - AssertTrue(rwops == NULL, "SDL_RWFromFile(NULL, NULL) worked"); - - rwops = SDL_RWFromFile(NULL, "sldfkjsldkfj"); - AssertTrue(rwops == NULL, "SDL_RWFromFile(NULL, \"sldfkjsldkfj\") worked"); - - rwops = SDL_RWFromFile("something", ""); - AssertTrue(rwops == NULL, "SDL_RWFromFile(\"something\", \"\") worked"); - - rwops = SDL_RWFromFile("something", NULL); - AssertTrue(rwops == NULL, "SDL_RWFromFile(\"something\", NULL) worked"); -} - - -/** - * @brief Tests opening from memory. - * - * \sa http://wiki.libsdl.org/moin.cgi/SDL_RWFromMem - */ -void rwops_testMem (void) -{ - char mem[sizeof(hello_world)]; - SDL_RWops *rw; - - /* Open. */ - rw = SDL_RWFromMem( mem, sizeof(hello_world)-1 ); - AssertTrue(rw != NULL, "Opening memory with SDL_RWFromMem"); - - /* Run generic tests. */ - _testGeneric( rw, 1 ); - - /* Close. */ - SDL_FreeRW( rw ); -} - - -/** - * @brief Tests opening from memory. - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_RWFromConstMem - */ -void rwops_testConstMem (void) -{ - SDL_RWops *rw; - - /* Open. */ - rw = SDL_RWFromConstMem( const_mem, sizeof(const_mem)-1 ); - AssertTrue(rw != NULL, "Opening memory with SDL_RWFromConstMem"); - - /* Run generic tests. */ - _testGeneric( rw, 0 ); - - /* Close. */ - SDL_FreeRW( rw ); -} - - -/** - * @brief Tests reading from memory. - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_RWFromFile - * http://wiki.libsdl.org/moin.cgi/SDL_FreeRW - */ -void -rwops_testFileRead(void) -{ - SDL_RWops *rw; - - /* Read test. */ - rw = SDL_RWFromFile(RWOPS_READ, "r"); - AssertTrue(rw != NULL, "Opening memory with SDL_RWFromFile RWOPS_READ"); - - _testGeneric( rw, 0 ); - - SDL_FreeRW( rw ); -} - -/** - * @brief Tests writing from memory. - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_RWFromFile - * http://wiki.libsdl.org/moin.cgi/SDL_FreeRW - */ -void -rwops_testFileWrite(void) -{ - SDL_RWops *rw; - - /* Write test. */ - rw = SDL_RWFromFile(RWOPS_WRITE, "w+"); - AssertTrue(rw != NULL, "Opening memory with SDL_RWFromFile RWOPS_WRITE"); - - _testGeneric( rw, 1 ); - - SDL_FreeRW( rw ); -} - - -/** - * @brief Tests reading from stdio - * - * \sa - * http://wiki.libsdl.org/moin.cgi/SDL_RWFromFP - * http://wiki.libsdl.org/moin.cgi/SDL_FreeRW - * - */ -void -rwops_testFPRead(void) -{ - FILE *fp; - SDL_RWops *rw; - - /* Run read tests. */ - fp = fopen(RWOPS_READ, "r"); - AssertTrue(fp != NULL, "Failed to open file %s,", RWOPS_READ); - - rw = SDL_RWFromFP( fp, 1 ); - AssertTrue(rw != NULL, "Opening memory with SDL_RWFromFP"); - - // TODO bail out if NULL - _testGeneric( rw, 0 ); - - SDL_FreeRW( rw ); - fclose(fp); -} - -void -rwops_testFPWrite(void) -{ - FILE *fp; - SDL_RWops *rw; - - /* Run write tests. */ - fp = fopen(RWOPS_WRITE, "w+"); - AssertTrue(fp != NULL, "Failed to open file %s", RWOPS_WRITE); - - rw = SDL_RWFromFP( fp, 1 ); - AssertTrue( rw != NULL, "Opening memory with SDL_RWFromFP"); - - _testGeneric( rw, 1 ); - - SDL_FreeRW( rw ); - fclose(fp); -} diff --git a/test/test-automation/tests/testsurface/Makefile.am b/test/test-automation/tests/testsurface/Makefile.am deleted file mode 100644 index 06fa5ea9a..000000000 --- a/test/test-automation/tests/testsurface/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestsurface.la -libtestsurface_la_SOURCES = testsurface.c -libtestsurface_la_CLAGS = -fPIC -g -libtestsurface_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testsurface/testsurface.c b/test/test-automation/tests/testsurface/testsurface.c deleted file mode 100644 index 43b775cfb..000000000 --- a/test/test-automation/tests/testsurface/testsurface.c +++ /dev/null @@ -1,675 +0,0 @@ -/** - * Original code: automated SDL surface test written by Edgar Simo "bobbens" - */ - -#include -#include - -#include - -#include "../../include/SDL_test.h" - -/* Test case references */ -static const TestCaseReference test1 = - (TestCaseReference){ "surface_testLoad", "Tests sprite loading.", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test2 = - (TestCaseReference){ "surface_testBlit", "Tests some blitting routines.", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test3 = - (TestCaseReference){ "surface_testBlitBlendNone", "Tests blitting routines with none blending.", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test4 = - (TestCaseReference){ "surface_testLoadFailure", "Tests sprite loading. A failure case.", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test5 = - (TestCaseReference){ "surface_testConversion", "Tests sprite conversion.", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test6 = - (TestCaseReference){ "surface_testBlitColorMod", "Tests some blitting routines with color mod.", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test7 = - (TestCaseReference){ "surface_testBlitAlphaMod", "Tests some blitting routines with alpha mod.", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test8 = - (TestCaseReference){ "surface_testBlitBlendLoop", "Test blittin routines with blending", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test9 = - (TestCaseReference){ "surface_testBlitBlendBlend", "Tests blitting routines with blend blending.", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test10 = - (TestCaseReference){ "surface_testBlitBlendAdd", "Tests blitting routines with add blending.", TEST_ENABLED, 0, 0}; - -static const TestCaseReference test11 = - (TestCaseReference){ "surface_testBlitBlendMod", "Tests blitting routines with modblending.", TEST_ENABLED, 0, 0}; - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, &test2, &test3, &test4, &test5, - &test6, &test7, &test8, &test9, &test10, &test11, NULL -}; - - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -/* Function prototypes */ -SDL_Surface *_CreateTestSurface(); - - -/* Create test fixture */ - -static SDL_Surface *testsur = NULL; - - -void -SetUp(void *arg) -{ - int ret = SDL_Init(SDL_INIT_VIDEO); - AssertTrue(ret == 0, "SDL_Init(SDL_INIT_VIDEO)"); - - testsur = _CreateTestSurface(); - AssertTrue(testsur != NULL, "SDL_Init(SDL_INIT_VIDEO)"); -} - -void -TearDown(void *arg) -{ - SDL_FreeSurface( testsur ); - - SDL_Quit(); -} - -/* Helper functions for the test cases */ - -#define TEST_SURFACE_WIDTH 80 -#define TEST_SURFACE_HEIGHT 60 - - -/*! - * Creates test surface - */ -SDL_Surface * -_CreateTestSurface() -{ - SDL_Surface *testsur = NULL; - - /* Create the test surface. */ - testsur = SDL_CreateRGBSurface( 0, - TEST_SURFACE_WIDTH, TEST_SURFACE_HEIGHT, 32, - RMASK, GMASK, BMASK, AMASK ); - - if(testsur->w != TEST_SURFACE_WIDTH) { - AssertFail("Test surface width doesn't match"); - } - - if(testsur->h != TEST_SURFACE_HEIGHT) { - AssertFail("Test surface height doesn't match"); - } - - AssertTrue(testsur != NULL, "SDL_CreateRGBSurface"); - - return testsur; -} - -/*! - * Create test surface from in-memory image - */ -SDL_Surface * -_createTestSurfaceFromMemory() -{ - SDL_Surface *face = NULL; - - /* Create face surface. */ - face = SDL_CreateRGBSurfaceFrom( (void*)img_face.pixel_data, - img_face.width, img_face.height, 32, img_face.width*4, - #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 - ); - AssertTrue(face != NULL, "SDL_CreateRGBSurfaceFrom"); - - return face; -} - -/** - * @brief Tests a blend mode. - */ -void _testBlitBlendMode(SDL_Surface *testsur, SDL_Surface *face, int mode) -{ - int ret; - int i, j, ni, nj; - SDL_Rect rect; - - AssertTrue(testsur != NULL, "testsur != NULL"); - AssertTrue(face != NULL, "face != NULL"); - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - AssertTrue(ret == 0, "SDL_FillRect"); - - /* Steps to take. */ - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - - /* Test blend mode. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - /* Set blend mode. */ - ret = SDL_SetSurfaceBlendMode( face, mode ); - AssertTrue(ret == 0, "SDL_SetSurfaceBlendMode"); - - /* Blitting. */ - rect.x = i; - rect.y = j; - // TODO Add pixel level validation, SDL_BlitSurface might be no-op - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - AssertTrue(ret == 0, "SDL_BlitSurface"); - } - } -} - -int -_AssertFileExist(const char *filename) -{ - struct stat st; - int ret = stat(filename, &st); - - AssertTrue(ret == 0, "Does file %s exist", filename); -} - -/* Test case functions */ -/** - * @brief Tests sprite loading - */ -void surface_testLoad(void *arg) -{ - int ret; - SDL_Surface *face, *rface; - - /* Clear surface. */ - /* - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - AssertTrue(ret == 0, "SDL_FillRect"); - */ - - /* Create the blit surface. */ - const char *filename = "data/images/icon.bmp"; - _AssertFileExist(filename); - - face = SDL_LoadBMP(filename); - AssertTrue(face != NULL, "SDL_CreateLoadBmp"); - - AssertTrue(face->w == 32, "testing icon width"); - AssertTrue(face->h == 32, "testing icon height"); -} - -/*! - * Tests sprite conversion. - */ -void surface_testConversion(void *arg) -{ - SDL_Surface *rface = NULL, *face = NULL; - int ret = 0; - - const char *filename = "data/images/icon.bmp"; - _AssertFileExist(filename); - - face = SDL_LoadBMP(filename); - AssertTrue(face != NULL, "SDL_CreateLoadBmp"); - - /* Set transparent pixel as the pixel at (0,0) */ - if (face->format->palette) { - ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels); - AssertTrue(ret == 0, "SDL_SetColorKey"); - } - - /* Convert to 32 bit to compare. */ - rface = SDL_ConvertSurface( face, testsur->format, 0 ); - AssertTrue(rface != NULL, "SDL_ConvertSurface"); - - /* See if it's the same. */ - AssertTrue(surface_compare( rface, &img_face, 0 ) == 0, - "Comparing primitives output."); - - /* Clean up. */ - SDL_FreeSurface( rface ); - SDL_FreeSurface( face ); -} - - -/** - * @brief Tests sprite loading. A failure case. - */ -void surface_testLoadFailure(void *arg) -{ - SDL_Surface *face = SDL_LoadBMP("nonexistant.bmp"); - AssertTrue(face == NULL, "SDL_CreateLoadBmp"); -} - -/** - * @brief Tests some blitting routines. - */ -void surface_testBlit(void *arg) -{ - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - - /* Clear surface. */ - - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - - AssertTrue(ret == 0, "SDL_FillRect"); - - face = _createTestSurfaceFromMemory(); - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - /* Loop blit. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - /* Blitting. */ - rect.x = i; - rect.y = j; - // TODO Add pixel level validation, SDL_BlitSurface might be no-op - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - - AssertTrue(ret == 0, "SDL_BlitSurface"); - } - } - - /* See if it's the same. */ - AssertTrue(surface_compare( testsur, &img_blit, 0 ) == 0, - "Comparing blitting output (normal blit)."); - - /* Clean up. */ - SDL_FreeSurface( face ); -} - -/** - * @brief Tests some blitting routines with color mod - */ -void surface_testBlitColorMod(void *arg) -{ - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - - /* Clear surface. */ - - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - - AssertTrue(ret == 0, "SDL_FillRect"); - - face = _createTestSurfaceFromMemory(); - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - AssertTrue(ret == 0, "SDL_FillRect"); - - /* Test blitting with colour mod. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - /* Set colour mod. */ - ret = SDL_SetSurfaceColorMod( face, (255/nj)*j, (255/ni)*i, (255/nj)*j ); - AssertTrue(ret == 0, "SDL_SetSurfaceColorMod"); - - /* Blitting. */ - rect.x = i; - rect.y = j; - // TODO Add pixel level validation, SDL_BlitSurface might be no-op - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - - AssertTrue(ret == 0, "SDL_BlitSurface"); - } - } - - /* See if it's the same. */ - AssertTrue(surface_compare( testsur, &img_blitColour, 0 ) == 0, - "Comparing blitting output (using SDL_SetSurfaceColorMod)."); - - /* Clean up. */ - SDL_FreeSurface( face ); -} - -/** - * @brief Tests some blitting routines with alpha mod - */ -void surface_testBlitAlphaMod(void *arg) -{ - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - - /* Clear surface. */ - - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - - AssertTrue(ret == 0, "SDL_FillRect"); - - face = _createTestSurfaceFromMemory(); - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - AssertTrue(ret == 0, "SDL_FillRect"); - - /* Restore colour. */ - ret = SDL_SetSurfaceColorMod( face, 255, 255, 255 ); - AssertTrue(ret == 0, "SDL_SetSurfaceColorMod"); - - /* Test blitting with colour mod. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - /* Set alpha mod. */ - ret = SDL_SetSurfaceAlphaMod( face, (255/ni)*i ); - AssertTrue(ret == 0, "SDL_SetSurfaceAlphaMod"); - - /* Blitting. */ - rect.x = i; - rect.y = j; - // TODO Add pixel level validation, SDL_BlitSurface might be no-op - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - AssertTrue(ret == 0, "SDL_BlitSurface"); - } - } - - /* See if it's the same. */ - AssertTrue(surface_compare( testsur, &img_blitAlpha, 0 ) == 0, - "Comparing blitting output (using SDL_SetSurfaceAlphaMod)."); - - /* Clean up. */ - SDL_FreeSurface( face ); -} - - -/** - * @brief Tests some more blitting routines. - */ -void surface_testBlitBlendNone(void *arg) -{ - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - int mode; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - AssertTrue(ret == 0, "SDL_FillRect"); - - face = _createTestSurfaceFromMemory(); - - /* Set alpha mod. */ - // TODO alpha value could be generated by fuzzer - ret = SDL_SetSurfaceAlphaMod( face, 100 ); - AssertTrue(ret == 0, "SDL_SetSurfaceAlphaMod"); - - /* Steps to take. */ - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - AssertTrue(ni != 0, "ni != 0"); - AssertTrue(nj != 0, "nj != 0"); - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - /* Test None. */ - _testBlitBlendMode( testsur, face, SDL_BLENDMODE_NONE ); - AssertTrue(surface_compare( testsur, &img_blendNone, 0 ) == 0, - "Comparing blitting blending output (using SDL_BLENDMODE_NONE)."); - - /* Test Blend. */ - _testBlitBlendMode( testsur, face, SDL_BLENDMODE_BLEND ); - AssertTrue(surface_compare( testsur, &img_blendBlend, 0 ) == 0, - "Comparing blitting blending output (using SDL_BLENDMODE_BLEND)."); - - /* Test Add. */ - _testBlitBlendMode( testsur, face, SDL_BLENDMODE_ADD ); - AssertTrue(surface_compare( testsur, &img_blendAdd, 0 ) == 0, - "Comparing blitting blending output (using SDL_BLENDMODE_ADD)."); - - /* Test Mod. */ - _testBlitBlendMode( testsur, face, SDL_BLENDMODE_MOD ); - AssertTrue(surface_compare( testsur, &img_blendMod, 0 ) == 0, - "Comparing blitting blending output not the same (using SDL_BLENDMODE_MOD)."); -} - -/** - * @brief Tests some more blitting routines. - */ -void surface_testBlitBlendBlend(void *arg) -{ - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - int mode; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - AssertTrue(ret == 0, "SDL_FillRect"); - - face = _createTestSurfaceFromMemory(); - - /* Set alpha mod. */ - // TODO alpha value could be generated by fuzzer - ret = SDL_SetSurfaceAlphaMod( face, 100 ); - AssertTrue(ret == 0, "SDL_SetSurfaceAlphaMod"); - - /* Steps to take. */ - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - AssertTrue(ni != 0, "ni != 0"); - AssertTrue(nj != 0, "nj != 0"); - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - - /* Test Blend. */ - _testBlitBlendMode( testsur, face, SDL_BLENDMODE_BLEND ); - AssertTrue(surface_compare( testsur, &img_blendBlend, 0 ) == 0, - "Comparing blitting blending output (using SDL_BLENDMODE_BLEND)."); -} - -/** - * @brief Tests some more blitting routines. - */ -void surface_testBlitBlendAdd(void *arg) -{ - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - int mode; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - AssertTrue(ret == 0, "SDL_FillRect"); - - face = _createTestSurfaceFromMemory(); - - /* Set alpha mod. */ - // TODO alpha value could be generated by fuzzer - ret = SDL_SetSurfaceAlphaMod( face, 100 ); - AssertTrue(ret == 0, "SDL_SetSurfaceAlphaMod"); - - /* Steps to take. */ - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - AssertTrue(ni != 0, "ni != 0"); - AssertTrue(nj != 0, "nj != 0"); - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - - /* Test Add. */ - _testBlitBlendMode( testsur, face, SDL_BLENDMODE_ADD ); - AssertTrue(surface_compare( testsur, &img_blendAdd, 0 ) == 0, - "Comparing blitting blending output (using SDL_BLENDMODE_ADD)."); -} - -/** - * @brief Tests some more blitting routines. - */ -void surface_testBlitBlendMod(void *arg) -{ - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - int mode; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - AssertTrue(ret == 0, "SDL_FillRect"); - - face = _createTestSurfaceFromMemory(); - - /* Set alpha mod. */ - // TODO alpha value could be generated by fuzzer - ret = SDL_SetSurfaceAlphaMod( face, 100 ); - AssertTrue(ret == 0, "SDL_SetSurfaceAlphaMod"); - - /* Steps to take. */ - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - AssertTrue(ni != 0, "ni != 0"); - AssertTrue(nj != 0, "nj != 0"); - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - /* Test None. */ - - /* Test Mod. */ - _testBlitBlendMode( testsur, face, SDL_BLENDMODE_MOD ); - AssertTrue(surface_compare( testsur, &img_blendMod, 0 ) == 0, - "Comparing blitting blending output (using SDL_BLENDMODE_MOD)."); -} - -/** - * @brief Tests some more blitting routines with loop - */ -void surface_testBlitBlendLoop(void *arg) { - int ret; - SDL_Rect rect; - SDL_Surface *face; - int i, j, ni, nj; - int mode; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - AssertTrue(ret == 0, "SDL_FillRect"); - - face = _createTestSurfaceFromMemory(); - - /* Set alpha mod. */ - // TODO alpha value could be generated by fuzzer - ret = SDL_SetSurfaceAlphaMod( face, 100 ); - AssertTrue(ret == 0, "SDL_SetSurfaceAlphaMod"); - - /* Steps to take. */ - ni = testsur->w - face->w; - nj = testsur->h - face->h; - - AssertTrue(ni != 0, "ni != 0"); - AssertTrue(nj != 0, "nj != 0"); - - /* Constant values. */ - rect.w = face->w; - rect.h = face->h; - - /* Clear surface. */ - ret = SDL_FillRect( testsur, NULL, - SDL_MapRGB( testsur->format, 0, 0, 0 ) ); - - AssertTrue(ret == 0, "SDL_FillRect"); - - /* Loop blit. */ - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - - /* Set colour mod. */ - ret = SDL_SetSurfaceColorMod( face, (255/nj)*j, (255/ni)*i, (255/nj)*j ); - AssertTrue(ret == 0, "SDL_SetSurfaceColorMod"); - - /* Set alpha mod. */ - ret = SDL_SetSurfaceAlphaMod( face, (100/ni)*i ); - AssertTrue(ret == 0, "SDL_SetSurfaceAlphaMod"); - - /* Crazy blending mode magic. */ - mode = (i/4*j/4) % 4; - if (mode==0) mode = SDL_BLENDMODE_NONE; - else if (mode==1) mode = SDL_BLENDMODE_BLEND; - else if (mode==2) mode = SDL_BLENDMODE_ADD; - else if (mode==3) mode = SDL_BLENDMODE_MOD; - ret = SDL_SetSurfaceBlendMode( face, mode ); - - AssertTrue(ret == 0, "SDL_SetSurfaceBlendMode"); - - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_BlitSurface( face, NULL, testsur, &rect ); - AssertTrue(ret == 0, "SDL_BlitSurface"); - } - } - - /* Check to see if matches. */ - AssertTrue(surface_compare( testsur, &img_blendAll, 0 ) == 0, - "Surface comparison (surface_compare)."); - - /* Clean up. */ - SDL_FreeSurface( face ); -} diff --git a/test/test-automation/tests/testsyswm/Makefile.am b/test/test-automation/tests/testsyswm/Makefile.am deleted file mode 100644 index 2a3e8a617..000000000 --- a/test/test-automation/tests/testsyswm/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestsyswm.la -libtestsyswm_la_SOURCES = testsyswm.c -libtestsyswm_la_CLAGS = -fPIC -g -libtestsyswm_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testsyswm/testsyswm.c b/test/test-automation/tests/testsyswm/testsyswm.c deleted file mode 100644 index c1ed07c76..000000000 --- a/test/test-automation/tests/testsyswm/testsyswm.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - -#include "../../include/SDL_test.h" - - - -/*! - * Note: Add test for syswm here - * - */ - -/* Test cases */ -static const TestCaseReference test1 = - (TestCaseReference){ "syswm_test", "description", TEST_DISABLED, 0, 0 }; - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, NULL -}; - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -/** - * @brief Document test case here - */ -int -syswm_test(void *arg) -{ - AssertPass(""); -} diff --git a/test/test-automation/tests/testvideo/Makefile.am b/test/test-automation/tests/testvideo/Makefile.am deleted file mode 100644 index 75c806d9e..000000000 --- a/test/test-automation/tests/testvideo/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -lib_LTLIBRARIES = libtestvideo.la -libtestvideo_la_SOURCES = testvideo.c -libtestvideo_la_CLAGS = -fPIC -g -libtestvideo_la_LDFLAGS = `sdl-config --libs` -I ../../src/libSDLtest/.libs/libSDLtest.la diff --git a/test/test-automation/tests/testvideo/testvideo.c b/test/test-automation/tests/testvideo/testvideo.c deleted file mode 100644 index bedfcac66..000000000 --- a/test/test-automation/tests/testvideo/testvideo.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - -#include "../../include/SDL_test.h" - - - -/*! - * Note: Add test for video here - * - */ - -/* Test cases */ -static const TestCaseReference test1 = - (TestCaseReference){ "video_test", "video stuff", TEST_DISABLED, 0, 0 }; - -/* Test suite */ -extern const TestCaseReference *testSuite[] = { - &test1, NULL -}; - -TestCaseReference **QueryTestSuite() { - return (TestCaseReference **)testSuite; -} - -/** - * @brief Document test case here - */ -int -video_test(void *arg) -{ - AssertPass(""); -} diff --git a/test/testatomic.c b/test/testatomic.c index 7bcceb559..be60a611b 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -53,7 +53,7 @@ void RunBasicTest() printf("AtomicUnlock lock=%d\n", lock); printf("\natomic -----------------------------------------\n\n"); - + SDL_AtomicSet(&v, 0); tfret = SDL_AtomicSet(&v, 10) == 0; printf("AtomicSet(10) tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v)); @@ -91,31 +91,31 @@ void RunBasicTest() /* Tests semantics of atomic operations. Also a stress test * to see if they are really atomic. * - * Serveral threads adding to the same variable. + * Several threads adding to the same variable. * at the end the value is compared with the expected * and with a non-atomic counter. */ - + /* Number of concurrent incrementers */ #define NThreads 2 #define CountInc 100 #define VALBITS (sizeof(atomicValue)*8) - + #define atomicValue int #define CountTo ((atomicValue)((unsigned int)(1<<(VALBITS-1))-1)) #define NInter (CountTo/CountInc/NThreads) #define Expect (CountTo-NInter*CountInc*NThreads) - + SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */ - + static SDL_atomic_t good = { 42 }; - + static atomicValue bad = 42; - + static SDL_atomic_t threadsRunning; static SDL_sem *threadDone; - + static int adder(void* junk) { @@ -129,111 +129,111 @@ int adder(void* junk) SDL_SemPost(threadDone); return 0; } - + static void runAdder(void) { Uint32 start, end; int T=NThreads; - + start = SDL_GetTicks(); - + threadDone = SDL_CreateSemaphore(0); SDL_AtomicSet(&threadsRunning, NThreads); while (T--) SDL_CreateThread(adder, "Adder", NULL); - + while (SDL_AtomicGet(&threadsRunning) > 0) SDL_SemWait(threadDone); - + SDL_DestroySemaphore(threadDone); end = SDL_GetTicks(); - + printf("Finished in %f sec\n", (end - start) / 1000.f); } - + static void RunEpicTest() { int b; atomicValue v; - + printf("\nepic test---------------------------------------\n\n"); printf("Size asserted to be >= 32-bit\n"); SDL_assert(sizeof(atomicValue)>=4); - + printf("Check static initializer\n"); v=SDL_AtomicGet(&good); SDL_assert(v==42); - + SDL_assert(bad==42); - + printf("Test negative values\n"); SDL_AtomicSet(&good, -5); v=SDL_AtomicGet(&good); SDL_assert(v==-5); - + printf("Verify maximum value\n"); SDL_AtomicSet(&good, CountTo); v=SDL_AtomicGet(&good); SDL_assert(v==CountTo); - + printf("Test compare and exchange\n"); - + b=SDL_AtomicCAS(&good, 500, 43); SDL_assert(!b); /* no swap since CountTo!=500 */ v=SDL_AtomicGet(&good); SDL_assert(v==CountTo); /* ensure no swap */ - + b=SDL_AtomicCAS(&good, CountTo, 44); SDL_assert(!!b); /* will swap */ v=SDL_AtomicGet(&good); SDL_assert(v==44); - + printf("Test Add\n"); - + v=SDL_AtomicAdd(&good, 1); SDL_assert(v==44); v=SDL_AtomicGet(&good); SDL_assert(v==45); - + v=SDL_AtomicAdd(&good, 10); SDL_assert(v==45); v=SDL_AtomicGet(&good); SDL_assert(v==55); - + printf("Test Add (Negative values)\n"); - + v=SDL_AtomicAdd(&good, -20); SDL_assert(v==55); v=SDL_AtomicGet(&good); SDL_assert(v==35); - + v=SDL_AtomicAdd(&good, -50); /* crossing zero down */ SDL_assert(v==35); v=SDL_AtomicGet(&good); SDL_assert(v==-15); - + v=SDL_AtomicAdd(&good, 30); /* crossing zero up */ SDL_assert(v==-15); v=SDL_AtomicGet(&good); SDL_assert(v==15); - + printf("Reset before count down test\n"); SDL_AtomicSet(&good, CountTo); v=SDL_AtomicGet(&good); SDL_assert(v==CountTo); - + bad=CountTo; SDL_assert(bad==CountTo); - + printf("Counting down from %d, Expect %d remaining\n",CountTo,Expect); runAdder(); - + v=SDL_AtomicGet(&good); printf("Atomic %d Non-Atomic %d\n",v,bad); SDL_assert(v==Expect); @@ -498,7 +498,6 @@ static int FIFO_Writer(void* _data) { WriterData *data = (WriterData *)_data; SDL_EventQueue *queue = data->queue; - int index = data->index; int i; SDL_Event event; @@ -599,7 +598,7 @@ static void RunFIFOTest(SDL_bool lock_free) Uint32 start, end; int i, j; int grand_total; - + printf("\nFIFO test---------------------------------------\n\n"); printf("Mode: %s\n", lock_free ? "LockFree" : "Mutex"); @@ -614,7 +613,7 @@ static void RunFIFOTest(SDL_bool lock_free) } start = SDL_GetTicks(); - + #ifdef TEST_SPINLOCK_FIFO /* Start a monitoring thread */ if (lock_free) { @@ -646,12 +645,12 @@ static void RunFIFOTest(SDL_bool lock_free) writerData[i].lock_free = lock_free; SDL_CreateThread(FIFO_Writer, name, &writerData[i]); } - + /* Wait for the writers */ while (SDL_AtomicGet(&writersRunning) > 0) { SDL_SemWait(writersDone); } - + /* Shut down the queue so readers exit */ queue.active = SDL_FALSE; @@ -661,14 +660,14 @@ static void RunFIFOTest(SDL_bool lock_free) } end = SDL_GetTicks(); - + SDL_DestroySemaphore(readersDone); SDL_DestroySemaphore(writersDone); if (!lock_free) { SDL_DestroyMutex(queue.mutex); } - + printf("Finished in %f sec\n", (end - start) / 1000.f); printf("\n"); diff --git a/test/testaudioinfo.c b/test/testaudioinfo.c index ff7c25b7f..c1d7fa389 100644 --- a/test/testaudioinfo.c +++ b/test/testaudioinfo.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ print_devices(int iscapture) printf("%s devices:\n", typestr); if (n == -1) - printf(" Driver can't detect specific devices.\n\n", typestr); + printf(" Driver can't detect specific %s devices.\n\n", typestr); else if (n == 0) printf(" No %s devices found.\n\n", typestr); else { diff --git a/test/testautomation.c b/test/testautomation.c index a32853c53..5eea7ec6f 100644 --- a/test/testautomation.c +++ b/test/testautomation.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -57,27 +57,27 @@ main(int argc, char *argv[]) if (argv[i + 1]) { testIterations = SDL_atoi(argv[i + 1]); if (testIterations < 1) testIterations = 1; - consumed = 2; + consumed = 2; } - } + } else if (SDL_strcasecmp(argv[i], "--execKey") == 0) { if (argv[i + 1]) { SDL_sscanf(argv[i + 1], "%llu", (long long unsigned int *)&userExecKey); - consumed = 2; + consumed = 2; } - } + } else if (SDL_strcasecmp(argv[i], "--seed") == 0) { if (argv[i + 1]) { userRunSeed = SDL_strdup(argv[i + 1]); consumed = 2; } - } + } else if (SDL_strcasecmp(argv[i], "--filter") == 0) { if (argv[i + 1]) { filter = SDL_strdup(argv[i + 1]); consumed = 2; } - } + } } if (consumed < 0) { fprintf(stderr, @@ -85,11 +85,11 @@ main(int argc, char *argv[]) argv[0], SDLTest_CommonUsage(state)); quit(1); } - + i += consumed; } - /* Initialize common state */ + /* Initialize common state */ if (!SDLTest_CommonInit(state)) { quit(2); } @@ -104,7 +104,7 @@ main(int argc, char *argv[]) /* Call Harness */ result = SDLTest_RunSuites(testSuites, (const char *)userRunSeed, userExecKey, (const char *)filter, testIterations); - /* Empty event queue */ + /* Empty event queue */ done = 0; for (i=0; i<100; i++) { while (SDL_PollEvent(&event)) { @@ -120,9 +120,9 @@ main(int argc, char *argv[]) if (filter != NULL) { SDL_free(filter); } - + /* Shutdown everything */ - quit(result); + quit(result); return(result); } diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index b593e0da1..90b08acbd 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -16,21 +16,182 @@ void _audioSetUp(void *arg) { - /* Start SDL audio subsystem */ - int ret = SDL_InitSubSystem( SDL_INIT_AUDIO ); + /* Start SDL audio subsystem */ + int ret = SDL_InitSubSystem( SDL_INIT_AUDIO ); SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO)"); - SDLTest_AssertCheck(ret==0, "Check result from SDL_InitSubSystem(SDL_INIT_AUDIO)"); - if (ret != 0) { + SDLTest_AssertCheck(ret==0, "Check result from SDL_InitSubSystem(SDL_INIT_AUDIO)"); + if (ret != 0) { SDLTest_LogError("%s", SDL_GetError()); } } +/* Test callback function */ +void _audio_testCallback(void *userdata, Uint8 *stream, int len) +{ + /* TODO: add tracking if callback was called */ +} + + /* Test case functions */ +/** + * \brief Stop and restart audio subsystem + * + * \sa http://wiki.libsdl.org/moin.cgi/SDL_QuitSubSystem + * \sa http://wiki.libsdl.org/moin.cgi/SDL_InitSubSystem + */ +int audio_quitInitAudioSubSystem() +{ + /* Stop SDL audio subsystem */ + SDL_QuitSubSystem( SDL_INIT_AUDIO ); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + + /* Restart audio again */ + _audioSetUp(NULL); + + return TEST_COMPLETED; +} + +/** + * \brief Start and stop audio directly + * + * \sa http://wiki.libsdl.org/moin.cgi/SDL_InitAudio + * \sa http://wiki.libsdl.org/moin.cgi/SDL_QuitAudio + */ +int audio_initQuitAudio() +{ + int result; + int i, iMax; + const char* audioDriver; + + /* Stop SDL audio subsystem */ + SDL_QuitSubSystem( SDL_INIT_AUDIO ); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + + /* Loop over all available audio drivers */ + iMax = SDL_GetNumAudioDrivers(); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers"); + SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); + for (i = 0; i < iMax; i++) { + audioDriver = SDL_GetAudioDriver(i); + SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); + SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL"); + SDLTest_AssertCheck(SDL_strlen(audioDriver) > 0, "Audio driver name is not empty; got: %s", audioDriver); + + /* Call Init */ + result = SDL_AudioInit(audioDriver); + SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); + SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); + + /* Call Quit */ + SDL_AudioQuit(); + SDLTest_AssertPass("Call to SDL_AudioQuit()"); + } + + /* NULL driver specification */ + audioDriver = NULL; + + /* Call Init */ + result = SDL_AudioInit(audioDriver); + SDLTest_AssertPass("Call to SDL_AudioInit(NULL)"); + SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); + + /* Call Quit */ + SDL_AudioQuit(); + SDLTest_AssertPass("Call to SDL_AudioQuit()"); + + /* Restart audio again */ + _audioSetUp(NULL); + + return TEST_COMPLETED; +} + +/** + * \brief Start, open, close and stop audio + * + * \sa http://wiki.libsdl.org/moin.cgi/SDL_InitAudio + * \sa http://wiki.libsdl.org/moin.cgi/SDL_OpenAudio + * \sa http://wiki.libsdl.org/moin.cgi/SDL_CloseAudio + * \sa http://wiki.libsdl.org/moin.cgi/SDL_QuitAudio + */ +int audio_initOpenCloseQuitAudio() +{ + int result; + int i, iMax, j; + const char* audioDriver; + SDL_AudioSpec desired; + + /* Stop SDL audio subsystem */ + SDL_QuitSubSystem( SDL_INIT_AUDIO ); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + + /* Loop over all available audio drivers */ + iMax = SDL_GetNumAudioDrivers(); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers"); + SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); + for (i = 0; i < iMax; i++) { + audioDriver = SDL_GetAudioDriver(i); + SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); + SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL"); + SDLTest_AssertCheck(SDL_strlen(audioDriver) > 0, "Audio driver name is not empty; got: %s", audioDriver); + + /* Change specs */ + for (j = 0; j < 2; j++) { + + /* Call Init */ + result = SDL_AudioInit(audioDriver); + SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); + SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); + + /* Set spec */ + SDL_memset(&desired, 0, sizeof(desired)); + switch (j) { + case 0: + /* Set standard desired spec */ + desired.freq = 22050; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 4096; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + + case 1: + /* Set custom desired spec */ + desired.freq = 48000; + desired.format = AUDIO_F32SYS; + desired.channels = 2; + desired.samples = 2048; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + break; + } + + /* Call Open */ + result = SDL_OpenAudio(&desired, NULL); + SDLTest_AssertPass("Call to SDL_OpenAudio(desired_spec_%d, NULL)", j); + SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0 got: %d", result); + + /* Call Close */ + SDL_CloseAudio(); + SDLTest_AssertPass("Call to SDL_CloseAudio()"); + + /* Call Quit */ + SDL_AudioQuit(); + SDLTest_AssertPass("Call to SDL_AudioQuit()"); + + } /* spec loop */ + } /* driver loop */ + + /* Restart audio again */ + _audioSetUp(NULL); + + return TEST_COMPLETED; +} + /** * \brief Enumerate and name available audio devices (output and capture). - * + * * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetNumAudioDevices * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioDeviceName */ @@ -42,7 +203,7 @@ int audio_enumerateAndNameAudioDevices() /* Iterate over types: t=0 output device, t=1 input/capture device */ for (t=0; t<2; t++) { - + /* Get number of devices. */ n = SDL_GetNumAudioDevices(t); SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(%i)", t); @@ -56,8 +217,8 @@ int audio_enumerateAndNameAudioDevices() SDLTest_AssertCheck(n==nn, "Verify result from SDL_GetNumAudioDevices(%i), expected same number of audio devices %i, got %i", tt, n, nn); nn = SDL_GetNumAudioDevices(-tt); SDLTest_AssertCheck(n==nn, "Verify result from SDL_GetNumAudioDevices(%i), expected same number of audio devices %i, got %i", -tt, n, nn); - } - + } + /* List devices. */ if (n>0) { for (i=0; i0, "Verify result from SDL_GetAudioDeviceName(%i, %i) is not empty, got: '%s'", i, tt, nameAgain); - SDLTest_AssertCheck(SDL_strcmp(name, nameAgain)==0, - "Verify SDL_GetAudioDeviceName(%i, %i) and SDL_GetAudioDeviceName(%i %i) return the same string", + SDLTest_AssertCheck(SDL_strcmp(name, nameAgain)==0, + "Verify SDL_GetAudioDeviceName(%i, %i) and SDL_GetAudioDeviceName(%i %i) return the same string", i, t, i, tt); } } @@ -82,13 +243,13 @@ int audio_enumerateAndNameAudioDevices() } } } - + return TEST_COMPLETED; } /** * \brief Negative tests around enumeration and naming of audio devices. - * + * * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetNumAudioDevices * \sa http://wiki.libsdl.org/moin.cgi/SDL_GetAudioDeviceName */ @@ -97,13 +258,13 @@ int audio_enumerateAndNameAudioDevicesNegativeTests() int t; int i, j, no, nc; const char *name; - + /* Get number of devices. */ no = SDL_GetNumAudioDevices(0); SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); nc = SDL_GetNumAudioDevices(1); SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(1)"); - + /* Invalid device index when getting name */ for (t=0; t<2; t++) { /* Negative device index */ @@ -111,7 +272,7 @@ int audio_enumerateAndNameAudioDevicesNegativeTests() name = SDL_GetAudioDeviceName(i, t); SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); SDLTest_AssertCheck(name == NULL, "Check SDL_GetAudioDeviceName(%i, %i) result NULL, expected NULL, got: %s", i, t, (name == NULL) ? "NULL" : name); - + /* Device index past range */ for (j=0; j<3; j++) { i = (t) ? nc+j : no+j; @@ -119,7 +280,7 @@ int audio_enumerateAndNameAudioDevicesNegativeTests() SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); SDLTest_AssertCheck(name == NULL, "Check SDL_GetAudioDeviceName(%i, %i) result, expected: NULL, got: %s", i, t, (name == NULL) ? "NULL" : name); } - + /* Capture index past capture range but within output range */ if ((no>0) && (no>nc) && (t==1)) { i = no-1; @@ -148,7 +309,7 @@ int audio_printAudioDrivers() n = SDL_GetNumAudioDrivers(); SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(n>=0, "Verify number of audio drivers >= 0, got: %i", n); - + /* List drivers. */ if (n>0) { @@ -185,17 +346,17 @@ int audio_printCurrentAudioDriver() } /* Definition of all formats, channels, and frequencies used to test audio conversions */ -const int _numFormats = 18; -SDL_AudioFormat _formats[] = { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S16SYS, AUDIO_S16, AUDIO_U16LSB, - AUDIO_U16MSB, AUDIO_U16SYS, AUDIO_U16, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S32SYS, AUDIO_S32, +const int _numAudioFormats = 18; +SDL_AudioFormat _audioFormats[] = { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S16SYS, AUDIO_S16, AUDIO_U16LSB, + AUDIO_U16MSB, AUDIO_U16SYS, AUDIO_U16, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S32SYS, AUDIO_S32, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_F32SYS, AUDIO_F32 }; -char *_formatsVerbose[] = { "AUDIO_S8", "AUDIO_U8", "AUDIO_S16LSB", "AUDIO_S16MSB", "AUDIO_S16SYS", "AUDIO_S16", "AUDIO_U16LSB", - "AUDIO_U16MSB", "AUDIO_U16SYS", "AUDIO_U16", "AUDIO_S32LSB", "AUDIO_S32MSB", "AUDIO_S32SYS", "AUDIO_S32", +char *_audioFormatsVerbose[] = { "AUDIO_S8", "AUDIO_U8", "AUDIO_S16LSB", "AUDIO_S16MSB", "AUDIO_S16SYS", "AUDIO_S16", "AUDIO_U16LSB", + "AUDIO_U16MSB", "AUDIO_U16SYS", "AUDIO_U16", "AUDIO_S32LSB", "AUDIO_S32MSB", "AUDIO_S32SYS", "AUDIO_S32", "AUDIO_F32LSB", "AUDIO_F32MSB", "AUDIO_F32SYS", "AUDIO_F32" }; -const int _numChannels = 4; -Uint8 _channels[] = { 1, 2, 4, 6 }; -const int _numFrequencies = 4; -int _frequencies[] = { 11025, 22050, 44100, 48000 }; +const int _numAudioChannels = 4; +Uint8 _audioChannels[] = { 1, 2, 4, 6 }; +const int _numAudioFrequencies = 4; +int _audioFrequencies[] = { 11025, 22050, 44100, 48000 }; /** @@ -210,7 +371,7 @@ int audio_buildAudioCVT() SDL_AudioSpec spec1; SDL_AudioSpec spec2; int i, ii, j, jj, k, kk; - + /* No conversion needed */ spec1.format = AUDIO_S16LSB; spec1.channels = 2; @@ -226,29 +387,29 @@ int audio_buildAudioCVT() spec1.freq = 22050; spec2.format = AUDIO_S16LSB; spec2.channels = 2; - spec2.freq = 44100; + spec2.freq = 44100; result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, spec2.format, spec2.channels, spec2.freq); SDLTest_AssertPass("Call to SDL_BuildAudioCVT(spec1 ==> spec2)"); SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result); /* All source conversions with random conversion targets, allow 'null' conversions */ - for (i = 0; i < _numFormats; i++) { - for (j = 0; j < _numChannels; j++) { - for (k = 0; k < _numFrequencies; k++) { - spec1.format = _formats[i]; - spec1.channels = _channels[j]; - spec1.freq = _frequencies[k]; - ii = SDLTest_RandomIntegerInRange(0, _numFormats - 1); - jj = SDLTest_RandomIntegerInRange(0, _numChannels - 1); - kk = SDLTest_RandomIntegerInRange(0, _numFrequencies - 1); - spec2.format = _formats[ii]; - spec2.channels = _channels[jj]; - spec2.freq = _frequencies[kk]; + for (i = 0; i < _numAudioFormats; i++) { + for (j = 0; j < _numAudioChannels; j++) { + for (k = 0; k < _numAudioFrequencies; k++) { + spec1.format = _audioFormats[i]; + spec1.channels = _audioChannels[j]; + spec1.freq = _audioFrequencies[k]; + ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1); + jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1); + kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1); + spec2.format = _audioFormats[ii]; + spec2.channels = _audioChannels[jj]; + spec2.freq = _audioFrequencies[kk]; result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, spec2.format, spec2.channels, spec2.freq); - SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", - i, _formatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _formatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", + i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); SDLTest_AssertCheck(result == 0 || result == 1, "Verify result value; expected: 0 or 1, got: %i", result); if (result<0) { SDLTest_LogError(SDL_GetError()); @@ -270,7 +431,7 @@ int audio_buildAudioCVT() int audio_buildAudioCVTNegative() { const char *expectedError = "Parameter 'cvt' is invalid"; - const char *error; + const char *error; int result; SDL_AudioCVT cvt; SDL_AudioSpec spec1; @@ -278,13 +439,13 @@ int audio_buildAudioCVTNegative() int i; char message[256]; - /* Valid format */ + /* Valid format */ spec1.format = AUDIO_S8; spec1.channels = 1; spec1.freq = 22050; spec2.format = AUDIO_S16LSB; spec2.channels = 2; - spec2.freq = 44100; + spec2.freq = 44100; SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); @@ -293,51 +454,51 @@ int audio_buildAudioCVTNegative() result = SDL_BuildAudioCVT((SDL_AudioCVT *)NULL, spec1.format, spec1.channels, spec1.freq, spec2.format, spec2.channels, spec2.freq); SDLTest_AssertPass("Call to SDL_BuildAudioCVT(NULL,...)"); - SDLTest_AssertCheck(result == -1, "Verify result value; expected: -1, got: %i", result); + SDLTest_AssertCheck(result == -1, "Verify result value; expected: -1, got: %i", result); error = SDL_GetError(); SDLTest_AssertPass("Call to SDL_GetError()"); SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, "Validate error message, expected: '%s', got: '%s'", expectedError, error); } /* Invalid conversions */ for (i = 1; i < 64; i++) { - /* Valid format to start with */ + /* Valid format to start with */ spec1.format = AUDIO_S8; spec1.channels = 1; spec1.freq = 22050; spec2.format = AUDIO_S16LSB; spec2.channels = 2; - spec2.freq = 44100; + spec2.freq = 44100; SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); - + /* Set various invalid format inputs */ SDL_strlcpy(message, "Invalid: ", 256); if (i & 1) { SDL_strlcat(message, " spec1.format", 256); spec1.format = 0; } - if (i & 2) { + if (i & 2) { SDL_strlcat(message, " spec1.channels", 256); spec1.channels = 0; } - if (i & 4) { + if (i & 4) { SDL_strlcat(message, " spec1.freq", 256); spec1.freq = 0; } - if (i & 8) { + if (i & 8) { SDL_strlcat(message, " spec2.format", 256); spec2.format = 0; } - if (i & 16) { + if (i & 16) { SDL_strlcat(message, " spec2.channels", 256); spec2.channels = 0; } - if (i & 32) { + if (i & 32) { SDL_strlcat(message, " spec2.freq", 256); spec2.freq = 0; } @@ -353,7 +514,7 @@ int audio_buildAudioCVTNegative() SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); - + return TEST_COMPLETED; } @@ -370,18 +531,13 @@ int audio_getAudioStatus() result = SDL_GetAudioStatus(); SDLTest_AssertPass("Call to SDL_GetAudioStatus()"); SDLTest_AssertCheck(result == SDL_AUDIO_STOPPED || result == SDL_AUDIO_PLAYING || result == SDL_AUDIO_PAUSED, - "Verify returned value; expected: STOPPED (%i) | PLAYING (%i) | PAUSED (%i), got: %i", + "Verify returned value; expected: STOPPED (%i) | PLAYING (%i) | PAUSED (%i), got: %i", SDL_AUDIO_STOPPED, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED, result); return TEST_COMPLETED; } -/* Test callback function */ -void _audio_testCallback(void *userdata, Uint8 *stream, int len) -{ - /* TODO: add tracking if callback was called */ -} /** * \brief Opens, checks current audio status, and closes a device. @@ -393,10 +549,10 @@ int audio_openCloseAndGetAudioStatus() SDL_AudioStatus result; int i; int count; - char *device; + char *device; SDL_AudioDeviceID id; SDL_AudioSpec desired, obtained; - + /* Get number of devices. */ count = SDL_GetNumAudioDevices(0); SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); @@ -415,20 +571,20 @@ int audio_openCloseAndGetAudioStatus() desired.samples=4096; desired.callback=_audio_testCallback; desired.userdata=NULL; - + /* Open device */ id = SDL_OpenAudioDevice((const char *)device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device); SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %i", id); if (id > 1) { - + /* Check device audio status */ result = SDL_GetAudioDeviceStatus(id); SDLTest_AssertPass("Call to SDL_GetAudioDeviceStatus()"); SDLTest_AssertCheck(result == SDL_AUDIO_STOPPED || result == SDL_AUDIO_PLAYING || result == SDL_AUDIO_PAUSED, - "Verify returned value; expected: STOPPED (%i) | PLAYING (%i) | PAUSED (%i), got: %i", - SDL_AUDIO_STOPPED, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED, result); - + "Verify returned value; expected: STOPPED (%i) | PLAYING (%i) | PAUSED (%i), got: %i", + SDL_AUDIO_STOPPED, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED, result); + /* Close device again */ SDL_CloseAudioDevice(id); SDLTest_AssertPass("Call to SDL_CloseAudioDevice()"); @@ -437,7 +593,7 @@ int audio_openCloseAndGetAudioStatus() } else { SDLTest_Log("No devices to test with"); } - + return TEST_COMPLETED; } @@ -451,10 +607,10 @@ int audio_lockUnlockOpenAudioDevice() { int i; int count; - char *device; + char *device; SDL_AudioDeviceID id; SDL_AudioSpec desired, obtained; - + /* Get number of devices. */ count = SDL_GetNumAudioDevices(0); SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); @@ -473,24 +629,24 @@ int audio_lockUnlockOpenAudioDevice() desired.samples=4096; desired.callback=_audio_testCallback; desired.userdata=NULL; - + /* Open device */ id = SDL_OpenAudioDevice((const char *)device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device); SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %i", id); - if (id > 1) { + if (id > 1) { /* Lock to protect callback */ SDL_LockAudioDevice(id); SDLTest_AssertPass("SDL_LockAudioDevice(%i)", id); - + /* Simulate callback processing */ SDL_Delay(10); SDLTest_Log("Simulate callback processing - delay"); - - /* Unlock again*/ + + /* Unlock again*/ SDL_UnlockAudioDevice(id); - SDLTest_AssertPass("SDL_UnlockAudioDevice(%i)", id); - + SDLTest_AssertPass("SDL_UnlockAudioDevice(%i)", id); + /* Close device again */ SDL_CloseAudioDevice(id); SDLTest_AssertPass("Call to SDL_CloseAudioDevice()"); @@ -499,7 +655,7 @@ int audio_lockUnlockOpenAudioDevice() } else { SDLTest_Log("No devices to test with"); } - + return TEST_COMPLETED; } @@ -534,46 +690,46 @@ int audio_convertAudio() } SDLTest_Log(message); /* All source conversions with random conversion targets */ - for (i = 0; i < _numFormats; i++) { - for (j = 0; j < _numChannels; j++) { - for (k = 0; k < _numFrequencies; k++) { - spec1.format = _formats[i]; - spec1.channels = _channels[j]; - spec1.freq = _frequencies[k]; - + for (i = 0; i < _numAudioFormats; i++) { + for (j = 0; j < _numAudioChannels; j++) { + for (k = 0; k < _numAudioFrequencies; k++) { + spec1.format = _audioFormats[i]; + spec1.channels = _audioChannels[j]; + spec1.freq = _audioFrequencies[k]; + /* Ensure we have a different target format */ do { if (c & 1) { - ii = SDLTest_RandomIntegerInRange(0, _numFormats - 1); + ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1); } else { ii = 1; } if (c & 2) { - jj = SDLTest_RandomIntegerInRange(0, _numChannels - 1); + jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1); } else { jj= j; } if (c & 4) { - kk = SDLTest_RandomIntegerInRange(0, _numFrequencies - 1); + kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1); } else { kk = k; } } while ((i == ii) && (j == jj) && (k == kk)); - spec2.format = _formats[ii]; - spec2.channels = _channels[jj]; - spec2.freq = _frequencies[kk]; - + spec2.format = _audioFormats[ii]; + spec2.channels = _audioChannels[jj]; + spec2.freq = _audioFrequencies[kk]; + result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, spec2.format, spec2.channels, spec2.freq); - SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", - i, _formatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _formatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", + i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result); if (result != 1) { SDLTest_LogError(SDL_GetError()); } else { SDLTest_AssertCheck(cvt.len_mult > 0, "Verify that cvt.len_mult value; expected: >0, got: %i", cvt.len_mult); if (cvt.len_mult < 1) return TEST_ABORTED; - + /* Create some random data to convert */ l = 64; ll = l * cvt.len_mult; @@ -582,20 +738,20 @@ int audio_convertAudio() cvt.buf = (Uint8 *)SDL_malloc(ll); SDLTest_AssertCheck(cvt.buf != NULL, "Check data buffer to convert is not NULL"); if (cvt.buf == NULL) return TEST_ABORTED; - + /* Convert the data */ result = SDL_ConvertAudio(&cvt); SDLTest_AssertPass("Call to SDL_ConvertAudio()"); SDLTest_AssertCheck(result == 0, "Verify result value; expected: 0; got: %i", result); SDLTest_AssertCheck(cvt.buf != NULL, "Verify conversion buffer is not NULL"); SDLTest_AssertCheck(cvt.len_ratio > 0.0, "Verify conversion length ratio; expected: >0; got: %f", cvt.len_ratio); - + /* Free converted buffer */ if (cvt.buf != NULL) { - SDL_free(cvt.buf); - cvt.buf = NULL; - } - } + SDL_free(cvt.buf); + cvt.buf = NULL; + } + } } } } @@ -615,10 +771,10 @@ int audio_openCloseAudioDeviceConnected() int result = -1; int i; int count; - char *device; + char *device; SDL_AudioDeviceID id; SDL_AudioSpec desired, obtained; - + /* Get number of devices. */ count = SDL_GetNumAudioDevices(0); SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); @@ -637,7 +793,7 @@ int audio_openCloseAudioDeviceConnected() desired.samples=4096; desired.callback=_audio_testCallback; desired.userdata=NULL; - + /* Open device */ id = SDL_OpenAudioDevice((const char *)device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device); @@ -646,13 +802,13 @@ int audio_openCloseAudioDeviceConnected() /* TODO: enable test code when function is available in SDL2 */ -#ifdef AUDIODEVICECONNECTED_DEFINED +#ifdef AUDIODEVICECONNECTED_DEFINED /* Get connected status */ result = SDL_AudioDeviceConnected(id); SDLTest_AssertPass("Call to SDL_AudioDeviceConnected()"); #endif SDLTest_AssertCheck(result == 1, "Verify returned value; expected: 1; got: %i", result); - + /* Close device again */ SDL_CloseAudioDevice(id); SDLTest_AssertPass("Call to SDL_CloseAudioDevice()"); @@ -661,7 +817,7 @@ int audio_openCloseAudioDeviceConnected() } else { SDLTest_Log("No devices to test with"); } - + return TEST_COMPLETED; } @@ -671,53 +827,69 @@ int audio_openCloseAudioDeviceConnected() /* Audio test cases */ static const SDLTest_TestCaseReference audioTest1 = - { (SDLTest_TestCaseFp)audio_enumerateAndNameAudioDevices, "audio_enumerateAndNameAudioDevices", "Enumerate and name available audio devices (output and capture)", TEST_ENABLED }; + { (SDLTest_TestCaseFp)audio_enumerateAndNameAudioDevices, "audio_enumerateAndNameAudioDevices", "Enumerate and name available audio devices (output and capture)", TEST_ENABLED }; static const SDLTest_TestCaseReference audioTest2 = - { (SDLTest_TestCaseFp)audio_enumerateAndNameAudioDevicesNegativeTests, "audio_enumerateAndNameAudioDevicesNegativeTests", "Negative tests around enumeration and naming of audio devices.", TEST_ENABLED }; + { (SDLTest_TestCaseFp)audio_enumerateAndNameAudioDevicesNegativeTests, "audio_enumerateAndNameAudioDevicesNegativeTests", "Negative tests around enumeration and naming of audio devices.", TEST_ENABLED }; static const SDLTest_TestCaseReference audioTest3 = - { (SDLTest_TestCaseFp)audio_printAudioDrivers, "audio_printAudioDrivers", "Checks available audio driver names.", TEST_ENABLED }; + { (SDLTest_TestCaseFp)audio_printAudioDrivers, "audio_printAudioDrivers", "Checks available audio driver names.", TEST_ENABLED }; static const SDLTest_TestCaseReference audioTest4 = - { (SDLTest_TestCaseFp)audio_printCurrentAudioDriver, "audio_printCurrentAudioDriver", "Checks current audio driver name with initialized audio.", TEST_ENABLED }; + { (SDLTest_TestCaseFp)audio_printCurrentAudioDriver, "audio_printCurrentAudioDriver", "Checks current audio driver name with initialized audio.", TEST_ENABLED }; static const SDLTest_TestCaseReference audioTest5 = - { (SDLTest_TestCaseFp)audio_buildAudioCVT, "audio_buildAudioCVT", "Builds various audio conversion structures.", TEST_ENABLED }; + { (SDLTest_TestCaseFp)audio_buildAudioCVT, "audio_buildAudioCVT", "Builds various audio conversion structures.", TEST_ENABLED }; static const SDLTest_TestCaseReference audioTest6 = - { (SDLTest_TestCaseFp)audio_buildAudioCVTNegative, "audio_buildAudioCVTNegative", "Checks calls with invalid input to SDL_BuildAudioCVT", TEST_ENABLED }; + { (SDLTest_TestCaseFp)audio_buildAudioCVTNegative, "audio_buildAudioCVTNegative", "Checks calls with invalid input to SDL_BuildAudioCVT", TEST_ENABLED }; static const SDLTest_TestCaseReference audioTest7 = - { (SDLTest_TestCaseFp)audio_getAudioStatus, "audio_getAudioStatus", "Checks current audio status.", TEST_ENABLED }; + { (SDLTest_TestCaseFp)audio_getAudioStatus, "audio_getAudioStatus", "Checks current audio status.", TEST_ENABLED }; static const SDLTest_TestCaseReference audioTest8 = - { (SDLTest_TestCaseFp)audio_openCloseAndGetAudioStatus, "audio_openCloseAndGetAudioStatus", "Opens and closes audio device and get audio status.", TEST_ENABLED }; + { (SDLTest_TestCaseFp)audio_openCloseAndGetAudioStatus, "audio_openCloseAndGetAudioStatus", "Opens and closes audio device and get audio status.", TEST_ENABLED }; static const SDLTest_TestCaseReference audioTest9 = - { (SDLTest_TestCaseFp)audio_lockUnlockOpenAudioDevice, "audio_lockUnlockOpenAudioDevice", "Locks and unlocks an open audio device.", TEST_ENABLED }; + { (SDLTest_TestCaseFp)audio_lockUnlockOpenAudioDevice, "audio_lockUnlockOpenAudioDevice", "Locks and unlocks an open audio device.", TEST_ENABLED }; /* TODO: enable test when SDL_ConvertAudio segfaults on cygwin have been fixed. */ /* For debugging, test case can be run manually using --filter audio_convertAudio */ static const SDLTest_TestCaseReference audioTest10 = - { (SDLTest_TestCaseFp)audio_convertAudio, "audio_convertAudio", "Convert audio using available formats.", TEST_DISABLED }; + { (SDLTest_TestCaseFp)audio_convertAudio, "audio_convertAudio", "Convert audio using available formats.", TEST_DISABLED }; /* TODO: enable test when SDL_AudioDeviceConnected has been implemented. */ static const SDLTest_TestCaseReference audioTest11 = - { (SDLTest_TestCaseFp)audio_openCloseAudioDeviceConnected, "audio_openCloseAudioDeviceConnected", "Opens and closes audio device and get connected status.", TEST_DISABLED }; + { (SDLTest_TestCaseFp)audio_openCloseAudioDeviceConnected, "audio_openCloseAudioDeviceConnected", "Opens and closes audio device and get connected status.", TEST_DISABLED }; + +static const SDLTest_TestCaseReference audioTest12 = + { (SDLTest_TestCaseFp)audio_quitInitAudioSubSystem, "audio_quitInitAudioSubSystem", "Quit and re-init audio subsystem.", TEST_ENABLED }; + +/* TODO: enable when bugs 1343 and 1396 are fixed. */ +/* For debugging, test case can be run manually using --filter audio_initQuitAudio */ + +static const SDLTest_TestCaseReference audioTest13 = + { (SDLTest_TestCaseFp)audio_initQuitAudio, "audio_initQuitAudio", "Init and quit audio drivers directly.", TEST_DISABLED }; + +/* TODO: enable when bugs 1343 and 1396 are fixed. */ +/* For debugging, test case can be run manually using --filter audio_initOpenCloseQuitAudio */ + +static const SDLTest_TestCaseReference audioTest14 = + { (SDLTest_TestCaseFp)audio_initOpenCloseQuitAudio, "audio_initOpenCloseQuitAudio", "Cycle through init, open, close and quit with various audio specs.", TEST_DISABLED }; /* Sequence of Audio test cases */ static const SDLTest_TestCaseReference *audioTests[] = { - &audioTest1, &audioTest2, &audioTest3, &audioTest4, &audioTest5, &audioTest6, - &audioTest7, &audioTest8, &audioTest9, &audioTest10, &audioTest11, NULL + &audioTest1, &audioTest2, &audioTest3, &audioTest4, &audioTest5, &audioTest6, + &audioTest7, &audioTest8, &audioTest9, &audioTest10, &audioTest11, + &audioTest12, &audioTest13, &audioTest14, NULL }; /* Audio test suite (global) */ SDLTest_TestSuiteReference audioTestSuite = { - "Audio", - _audioSetUp, - audioTests, - NULL + "Audio", + _audioSetUp, + audioTests, + NULL }; diff --git a/test/testautomation_clipboard.c b/test/testautomation_clipboard.c index 858b22bc8..92aec7d03 100644 --- a/test/testautomation_clipboard.c +++ b/test/testautomation_clipboard.c @@ -21,9 +21,9 @@ int clipboard_testHasClipboardText(void *arg) { - SDL_bool result; - result = SDL_HasClipboardText(); - SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); + SDL_bool result; + result = SDL_HasClipboardText(); + SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); return TEST_COMPLETED; } @@ -37,11 +37,11 @@ clipboard_testHasClipboardText(void *arg) int clipboard_testGetClipboardText(void *arg) { - char *charResult; - charResult = SDL_GetClipboardText(); - SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); + char *charResult; + charResult = SDL_GetClipboardText(); + SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); - if (charResult) SDL_free(charResult); + if (charResult) SDL_free(charResult); return TEST_COMPLETED; } @@ -54,19 +54,19 @@ clipboard_testGetClipboardText(void *arg) int clipboard_testSetClipboardText(void *arg) { - char *textRef = SDLTest_RandomAsciiString(); - char *text = SDL_strdup(textRef); - int result; - result = SDL_SetClipboardText((const char *)text); - SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded"); - SDLTest_AssertCheck( - result == 0, - "Validate SDL_SetClipboardText result, expected 0, got %i", - result); - SDLTest_AssertCheck( - SDL_strcmp(textRef, text) == 0, - "Verify SDL_SetClipboardText did not modify input string, expected '%s', got '%s'", - textRef, text); + char *textRef = SDLTest_RandomAsciiString(); + char *text = SDL_strdup(textRef); + int result; + result = SDL_SetClipboardText((const char *)text); + SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded"); + SDLTest_AssertCheck( + result == 0, + "Validate SDL_SetClipboardText result, expected 0, got %i", + result); + SDLTest_AssertCheck( + SDL_strcmp(textRef, text) == 0, + "Verify SDL_SetClipboardText did not modify input string, expected '%s', got '%s'", + textRef, text); /* Cleanup */ if (textRef) SDL_free(textRef); @@ -85,64 +85,64 @@ clipboard_testSetClipboardText(void *arg) int clipboard_testClipboardTextFunctions(void *arg) { - char *textRef = SDLTest_RandomAsciiString(); - char *text = SDL_strdup(textRef); - SDL_bool boolResult; - int intResult; - char *charResult; + char *textRef = SDLTest_RandomAsciiString(); + char *text = SDL_strdup(textRef); + SDL_bool boolResult; + int intResult; + char *charResult; - /* Clear clipboard text state */ - boolResult = SDL_HasClipboardText(); - SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); - if (boolResult == SDL_TRUE) { + /* Clear clipboard text state */ + boolResult = SDL_HasClipboardText(); + SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); + if (boolResult == SDL_TRUE) { intResult = SDL_SetClipboardText((const char *)NULL); - SDLTest_AssertPass("Call to DL_SetClipboardText(NULL) succeeded"); - SDLTest_AssertCheck( - intResult == 0, - "Verify result from SDL_SetClipboardText(NULL), expected 0, got %i", - intResult); - charResult = SDL_GetClipboardText(); - SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); - boolResult = SDL_HasClipboardText(); - SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); - SDLTest_AssertCheck( + SDLTest_AssertPass("Call to SDL_SetClipboardText(NULL) succeeded"); + SDLTest_AssertCheck( + intResult == 0, + "Verify result from SDL_SetClipboardText(NULL), expected 0, got %i", + intResult); + charResult = SDL_GetClipboardText(); + SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); + boolResult = SDL_HasClipboardText(); + SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); + SDLTest_AssertCheck( boolResult == SDL_FALSE, - "Verify SDL_HasClipboardText returned SDL_FALSE, got %s", - (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); + "Verify SDL_HasClipboardText returned SDL_FALSE, got %s", + (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); } /* Empty clipboard */ - charResult = SDL_GetClipboardText(); - SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); - SDLTest_AssertCheck( - charResult != NULL, - "Verify SDL_GetClipboardText did not return NULL"); - SDLTest_AssertCheck( - SDL_strlen(charResult) == 0, - "Verify SDL_GetClipboardText returned string with length 0, got length %i", - SDL_strlen(charResult)); + charResult = SDL_GetClipboardText(); + SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); + SDLTest_AssertCheck( + charResult != NULL, + "Verify SDL_GetClipboardText did not return NULL"); + SDLTest_AssertCheck( + SDL_strlen(charResult) == 0, + "Verify SDL_GetClipboardText returned string with length 0, got length %i", + SDL_strlen(charResult)); intResult = SDL_SetClipboardText((const char *)text); - SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded"); - SDLTest_AssertCheck( - intResult == 0, - "Verify result from SDL_SetClipboardText(NULL), expected 0, got %i", - intResult); - SDLTest_AssertCheck( - SDL_strcmp(textRef, text) == 0, - "Verify SDL_SetClipboardText did not modify input string, expected '%s', got '%s'", - textRef, text); - boolResult = SDL_HasClipboardText(); - SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); - SDLTest_AssertCheck( + SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded"); + SDLTest_AssertCheck( + intResult == 0, + "Verify result from SDL_SetClipboardText(NULL), expected 0, got %i", + intResult); + SDLTest_AssertCheck( + SDL_strcmp(textRef, text) == 0, + "Verify SDL_SetClipboardText did not modify input string, expected '%s', got '%s'", + textRef, text); + boolResult = SDL_HasClipboardText(); + SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); + SDLTest_AssertCheck( boolResult == SDL_TRUE, - "Verify SDL_HasClipboardText returned SDL_TRUE, got %s", - (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); - charResult = SDL_GetClipboardText(); - SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); - SDLTest_AssertCheck( - strcmp(textRef, charResult) == 0, - "Verify SDL_GetClipboardText returned correct string, expected '%s', got '%s'", - textRef, charResult); + "Verify SDL_HasClipboardText returned SDL_TRUE, got %s", + (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); + charResult = SDL_GetClipboardText(); + SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); + SDLTest_AssertCheck( + SDL_strcmp(textRef, charResult) == 0, + "Verify SDL_GetClipboardText returned correct string, expected '%s', got '%s'", + textRef, charResult); /* Cleanup */ if (textRef) SDL_free(textRef); @@ -157,26 +157,26 @@ clipboard_testClipboardTextFunctions(void *arg) /* Clipboard test cases */ static const SDLTest_TestCaseReference clipboardTest1 = - { (SDLTest_TestCaseFp)clipboard_testHasClipboardText, "clipboard_testHasClipboardText", "Check call to SDL_HasClipboardText", TEST_ENABLED }; + { (SDLTest_TestCaseFp)clipboard_testHasClipboardText, "clipboard_testHasClipboardText", "Check call to SDL_HasClipboardText", TEST_ENABLED }; static const SDLTest_TestCaseReference clipboardTest2 = - { (SDLTest_TestCaseFp)clipboard_testGetClipboardText, "clipboard_testGetClipboardText", "Check call to SDL_GetClipboardText", TEST_ENABLED }; + { (SDLTest_TestCaseFp)clipboard_testGetClipboardText, "clipboard_testGetClipboardText", "Check call to SDL_GetClipboardText", TEST_ENABLED }; static const SDLTest_TestCaseReference clipboardTest3 = - { (SDLTest_TestCaseFp)clipboard_testSetClipboardText, "clipboard_testSetClipboardText", "Check call to SDL_SetClipboardText", TEST_ENABLED }; + { (SDLTest_TestCaseFp)clipboard_testSetClipboardText, "clipboard_testSetClipboardText", "Check call to SDL_SetClipboardText", TEST_ENABLED }; static const SDLTest_TestCaseReference clipboardTest4 = - { (SDLTest_TestCaseFp)clipboard_testClipboardTextFunctions, "clipboard_testClipboardTextFunctions", "End-to-end test of SDL_xyzClipboardText functions", TEST_ENABLED }; + { (SDLTest_TestCaseFp)clipboard_testClipboardTextFunctions, "clipboard_testClipboardTextFunctions", "End-to-end test of SDL_xyzClipboardText functions", TEST_ENABLED }; /* Sequence of Clipboard test cases */ static const SDLTest_TestCaseReference *clipboardTests[] = { - &clipboardTest1, &clipboardTest2, &clipboardTest3, &clipboardTest4, NULL + &clipboardTest1, &clipboardTest2, &clipboardTest3, &clipboardTest4, NULL }; /* Clipboard test suite (global) */ SDLTest_TestSuiteReference clipboardTestSuite = { - "Clipboard", - NULL, - clipboardTests, - NULL + "Clipboard", + NULL, + clipboardTests, + NULL }; diff --git a/test/testautomation_events.c b/test/testautomation_events.c index 930d44cb3..638607e76 100644 --- a/test/testautomation_events.c +++ b/test/testautomation_events.c @@ -28,14 +28,14 @@ int _userdataValue2 = 2; int _events_sampleNullEventFilter(void *userdata, SDL_Event *event) { _eventFilterCalled = 1; - + if (_userdataCheck != 0) { SDLTest_AssertCheck(userdata != NULL, "Check userdata pointer, expected: non-NULL, got: %s", (userdata != NULL) ? "non-NULL" : "NULL"); if (userdata != NULL) { SDLTest_AssertCheck(*(int *)userdata == _userdataValue, "Check userdata value, expected: %i, got: %i", _userdataValue, *(int *)userdata); } } - + return 0; } @@ -51,24 +51,24 @@ events_pushPumpAndPollUserevent(void *arg) SDL_Event event1; SDL_Event event2; int result; - + /* Create user event */ event1.type = SDL_USEREVENT; event1.user.code = SDLTest_RandomSint32(); event1.user.data1 = (void *)&_userdataValue1; event1.user.data2 = (void *)&_userdataValue2; - + /* Push a user event onto the queue and force queue update*/ SDL_PushEvent(&event1); SDLTest_AssertPass("Call to SDL_PushEvent()"); SDL_PumpEvents(); SDLTest_AssertPass("Call to SDL_PumpEvents()"); - + /* Poll for user event */ result = SDL_PollEvent(&event2); SDLTest_AssertPass("Call to SDL_PollEvent()"); SDLTest_AssertCheck(result == 1, "Check result from SDL_PollEvent, expected: 1, got: %d", result); - + return TEST_COMPLETED; } @@ -84,7 +84,7 @@ int events_addDelEventWatch(void *arg) { SDL_Event event; - + /* Create user event */ event.type = SDL_USEREVENT; event.user.code = SDLTest_RandomSint32();; @@ -97,10 +97,10 @@ events_addDelEventWatch(void *arg) /* Reset event filter call tracker */ _eventFilterCalled = 0; - /* Add watch */ + /* Add watch */ SDL_AddEventWatch(_events_sampleNullEventFilter, NULL); SDLTest_AssertPass("Call to SDL_AddEventWatch()"); - + /* Push a user event onto the queue and force queue update*/ SDL_PushEvent(&event); SDLTest_AssertPass("Call to SDL_PushEvent()"); @@ -134,13 +134,13 @@ int events_addDelEventWatchWithUserdata(void *arg) { SDL_Event event; - + /* Create user event */ event.type = SDL_USEREVENT; event.user.code = SDLTest_RandomSint32();; event.user.data1 = (void *)&_userdataValue1; event.user.data2 = (void *)&_userdataValue2; - + /* Enable userdata check and set a value to check */ _userdataCheck = 1; _userdataValue = SDLTest_RandomIntegerInRange(-1024, 1024); @@ -148,7 +148,7 @@ events_addDelEventWatchWithUserdata(void *arg) /* Reset event filter call tracker */ _eventFilterCalled = 0; - /* Add watch */ + /* Add watch */ SDL_AddEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue); SDLTest_AssertPass("Call to SDL_AddEventWatch()"); @@ -162,7 +162,7 @@ events_addDelEventWatchWithUserdata(void *arg) /* Delete watch */ SDL_DelEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue); SDLTest_AssertPass("Call to SDL_DelEventWatch()"); - + /* Push a user event onto the queue and force queue update*/ _eventFilterCalled = 0; SDL_PushEvent(&event); @@ -170,7 +170,7 @@ events_addDelEventWatchWithUserdata(void *arg) SDL_PumpEvents(); SDLTest_AssertPass("Call to SDL_PumpEvents()"); SDLTest_AssertCheck(_eventFilterCalled == 0, "Check that event filter was NOT called"); - + return TEST_COMPLETED; } @@ -179,23 +179,23 @@ events_addDelEventWatchWithUserdata(void *arg) /* Events test cases */ static const SDLTest_TestCaseReference eventsTest1 = - { (SDLTest_TestCaseFp)events_pushPumpAndPollUserevent, "events_pushPumpAndPollUserevent", "Pushes, pumps and polls a user event", TEST_ENABLED }; + { (SDLTest_TestCaseFp)events_pushPumpAndPollUserevent, "events_pushPumpAndPollUserevent", "Pushes, pumps and polls a user event", TEST_ENABLED }; static const SDLTest_TestCaseReference eventsTest2 = - { (SDLTest_TestCaseFp)events_addDelEventWatch, "events_addDelEventWatch", "Adds and deletes an event watch function with NULL userdata", TEST_ENABLED }; + { (SDLTest_TestCaseFp)events_addDelEventWatch, "events_addDelEventWatch", "Adds and deletes an event watch function with NULL userdata", TEST_ENABLED }; static const SDLTest_TestCaseReference eventsTest3 = - { (SDLTest_TestCaseFp)events_addDelEventWatchWithUserdata, "events_addDelEventWatchWithUserdata", "Adds and deletes an event watch function with userdata", TEST_ENABLED }; + { (SDLTest_TestCaseFp)events_addDelEventWatchWithUserdata, "events_addDelEventWatchWithUserdata", "Adds and deletes an event watch function with userdata", TEST_ENABLED }; /* Sequence of Events test cases */ static const SDLTest_TestCaseReference *eventsTests[] = { - &eventsTest1, &eventsTest2, &eventsTest3, NULL + &eventsTest1, &eventsTest2, &eventsTest3, NULL }; /* Events test suite (global) */ SDLTest_TestSuiteReference eventsTestSuite = { - "Events", - NULL, - eventsTests, - NULL + "Events", + NULL, + eventsTests, + NULL }; diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c index ca6d2e355..453832e25 100644 --- a/test/testautomation_keyboard.c +++ b/test/testautomation_keyboard.c @@ -15,7 +15,7 @@ /** * @brief Check call to SDL_GetKeyboardState with and without numkeys reference. - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyboardState */ int @@ -24,24 +24,24 @@ keyboard_getKeyboardState(void *arg) int numkeys; Uint8 *state; - /* Case where numkeys pointer is NULL */ - state = SDL_GetKeyboardState(NULL); + /* Case where numkeys pointer is NULL */ + state = (Uint8 *)SDL_GetKeyboardState(NULL); SDLTest_AssertPass("Call to SDL_GetKeyboardState(NULL)"); SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL"); /* Case where numkeys pointer is not NULL */ numkeys = -1; - state = SDL_GetKeyboardState(&numkeys); + state = (Uint8 *)SDL_GetKeyboardState(&numkeys); SDLTest_AssertPass("Call to SDL_GetKeyboardState(&numkeys)"); SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL"); SDLTest_AssertCheck(numkeys >= 0, "Validate that value of numkeys is >= 0, got: %i", numkeys); - + return TEST_COMPLETED; } /** * @brief Check call to SDL_GetKeyboardFocus - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyboardFocus */ int @@ -58,7 +58,7 @@ keyboard_getKeyboardFocus(void *arg) /** * @brief Check call to SDL_GetKeyFromName for known, unknown and invalid name. - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyFromName */ int @@ -104,19 +104,19 @@ keyboard_getKeyFromName(void *arg) return TEST_COMPLETED; } -/* +/* * Local helper to check for the invalid scancode error message */ void _checkInvalidScancodeError() { const char *expectedError = "Parameter 'scancode' is invalid"; - const char *error; + const char *error; error = SDL_GetError(); SDLTest_AssertPass("Call to SDL_GetError()"); SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, "Validate error message, expected: '%s', got: '%s'", expectedError, error); SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); @@ -125,7 +125,7 @@ _checkInvalidScancodeError() /** * @brief Check call to SDL_GetKeyFromScancode - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyFromScancode */ int @@ -164,12 +164,12 @@ keyboard_getKeyFromScancode(void *arg) /** * @brief Check call to SDL_GetKeyName - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyName */ int keyboard_getKeyName(void *arg) -{ +{ char *result; char *expected; @@ -220,12 +220,12 @@ keyboard_getKeyName(void *arg) /** * @brief SDL_GetScancodeName negative cases - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeName */ int keyboard_getScancodeNameNegative(void *arg) -{ +{ SDL_Scancode scancode; char *result; char *expected = ""; @@ -234,16 +234,8 @@ keyboard_getScancodeNameNegative(void *arg) SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); - /* Negative scancode */ - scancode = (SDL_Scancode)SDLTest_RandomIntegerInRange(LONG_MIN, -1); - result = (char *)SDL_GetScancodeName(scancode); - SDLTest_AssertPass("Call to SDL_GetScancodeName(%d/negative)", scancode); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result); - _checkInvalidScancodeError(); - - /* Large scancode */ - scancode = (SDL_Scancode)SDLTest_RandomIntegerInRange(SDL_NUM_SCANCODES, LONG_MAX); + /* Out-of-bounds scancode */ + scancode = (SDL_Scancode)SDL_NUM_SCANCODES; result = (char *)SDL_GetScancodeName(scancode); SDLTest_AssertPass("Call to SDL_GetScancodeName(%d/large)", scancode); SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); @@ -255,12 +247,12 @@ keyboard_getScancodeNameNegative(void *arg) /** * @brief SDL_GetKeyName negative cases - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetKeyName */ int keyboard_getKeyNameNegative(void *arg) -{ +{ SDL_Keycode keycode; char *result; char *expected = ""; @@ -292,17 +284,17 @@ keyboard_getKeyNameNegative(void *arg) /** * @brief Check call to SDL_GetModState and SDL_SetModState - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetModState * @sa http://wiki.libsdl.org/moin.cgi/SDL_SetModState */ int keyboard_getSetModState(void *arg) -{ +{ SDL_Keymod result; SDL_Keymod currentState; SDL_Keymod newState; - SDL_Keymod allStates = + SDL_Keymod allStates = KMOD_NONE | KMOD_LSHIFT | KMOD_RSHIFT | @@ -317,13 +309,13 @@ keyboard_getSetModState(void *arg) KMOD_MODE | KMOD_RESERVED; - /* Get state, cache for later reset */ + /* Get state, cache for later reset */ result = SDL_GetModState(); SDLTest_AssertPass("Call to SDL_GetModState()"); - SDLTest_AssertCheck(result >=0 && result <= allStates, "Verify result from call is valid, expected: 0 <= result <= %i, got: %i", allStates, result); + SDLTest_AssertCheck(result >=0 && result <= allStates, "Verify result from call is valid, expected: 0 <= result <= %i, got: %i", allStates, result); currentState = result; - /* Set random state */ + /* Set random state */ newState = SDLTest_RandomIntegerInRange(0, allStates); SDL_SetModState(newState); SDLTest_AssertPass("Call to SDL_SetModState(%i)", newState); @@ -353,13 +345,13 @@ keyboard_getSetModState(void *arg) /** * @brief Check call to SDL_StartTextInput and SDL_StopTextInput - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_StartTextInput * @sa http://wiki.libsdl.org/moin.cgi/SDL_StopTextInput */ int keyboard_startStopTextInput(void *arg) -{ +{ /* Start-Stop */ SDL_StartTextInput(); SDLTest_AssertPass("Call to SDL_StartTextInput()"); @@ -369,12 +361,12 @@ keyboard_startStopTextInput(void *arg) /* Stop-Start */ SDL_StartTextInput(); SDLTest_AssertPass("Call to SDL_StartTextInput()"); - + /* Start-Start */ SDL_StartTextInput(); SDLTest_AssertPass("Call to SDL_StartTextInput()"); - /* Stop-Stop */ + /* Stop-Stop */ SDL_StopTextInput(); SDLTest_AssertPass("Call to SDL_StopTextInput()"); SDL_StopTextInput(); @@ -387,34 +379,34 @@ keyboard_startStopTextInput(void *arg) void _testSetTextInputRect(SDL_Rect refRect) { SDL_Rect testRect; - + testRect = refRect; SDL_SetTextInputRect(&testRect); SDLTest_AssertPass("Call to SDL_SetTextInputRect with refRect(x:%i,y:%i,w:%i,h:%i)", refRect.x, refRect.y, refRect.w, refRect.h); SDLTest_AssertCheck( - (refRect.x == testRect.x) && (refRect.y == testRect.y) && (refRect.w == testRect.w) && (refRect.h == testRect.h), - "Check that input data was not modified, expected: x:%i,y:%i,w:%i,h:%i, got: x:%i,y:%i,w:%i,h:%i", - refRect.x, refRect.y, refRect.w, refRect.h, + (refRect.x == testRect.x) && (refRect.y == testRect.y) && (refRect.w == testRect.w) && (refRect.h == testRect.h), + "Check that input data was not modified, expected: x:%i,y:%i,w:%i,h:%i, got: x:%i,y:%i,w:%i,h:%i", + refRect.x, refRect.y, refRect.w, refRect.h, testRect.x, testRect.y, testRect.w, testRect.h); } /** * @brief Check call to SDL_SetTextInputRect - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_SetTextInputRect */ int keyboard_setTextInputRect(void *arg) -{ +{ SDL_Rect refRect; - + /* Normal visible refRect, origin inside */ refRect.x = SDLTest_RandomIntegerInRange(1, 50);; refRect.y = SDLTest_RandomIntegerInRange(1, 50);; refRect.w = SDLTest_RandomIntegerInRange(10, 50); refRect.h = SDLTest_RandomIntegerInRange(10, 50); _testSetTextInputRect(refRect); - + /* Normal visible refRect, origin 0,0 */ refRect.x = 0; refRect.y = 0; @@ -480,133 +472,133 @@ keyboard_setTextInputRect(void *arg) /** * @brief Check call to SDL_SetTextInputRect with invalid data - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_SetTextInputRect */ int keyboard_setTextInputRectNegative(void *arg) -{ +{ /* Some platforms set also an error message; prepare for checking it */ -#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA +#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA const char *expectedError = "Parameter 'rect' is invalid"; const char *error; - + SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); #endif - + /* NULL refRect */ SDL_SetTextInputRect(NULL); SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); /* Some platforms set also an error message; so check it */ -#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA +#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA error = SDL_GetError(); SDLTest_AssertPass("Call to SDL_GetError()"); SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, "Validate error message, expected: '%s', got: '%s'", expectedError, error); } SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); #endif - + return TEST_COMPLETED; } /** * @brief Check call to SDL_GetScancodeFromKey - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeFromKey * @sa http://wiki.libsdl.org/moin.cgi/SDL_Keycode */ int keyboard_getScancodeFromKey(void *arg) -{ +{ SDL_Scancode scancode; - + /* Regular key */ scancode = SDL_GetScancodeFromKey(SDLK_4); SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_4)"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromKey, expected: %i, got: %i", SDL_SCANCODE_4, scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromKey, expected: %i, got: %i", SDL_SCANCODE_4, scancode); /* Virtual key */ scancode = SDL_GetScancodeFromKey(SDLK_PLUS); SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_PLUS)"); - SDLTest_AssertCheck(scancode == 0, "Validate return value from SDL_GetScancodeFromKey, expected: 0, got: %i", scancode); - + SDLTest_AssertCheck(scancode == 0, "Validate return value from SDL_GetScancodeFromKey, expected: 0, got: %i", scancode); + return TEST_COMPLETED; } /** * @brief Check call to SDL_GetScancodeFromName - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeFromName * @sa http://wiki.libsdl.org/moin.cgi/SDL_Keycode */ int keyboard_getScancodeFromName(void *arg) -{ +{ SDL_Scancode scancode; /* Regular key, 1 character, first name in list */ scancode = SDL_GetScancodeFromName("A"); SDLTest_AssertPass("Call to SDL_GetScancodeFromName('A')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_A, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_A, scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_A, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_A, scancode); /* Regular key, 1 character */ scancode = SDL_GetScancodeFromName("4"); SDLTest_AssertPass("Call to SDL_GetScancodeFromName('4')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_4, scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_4, scancode); /* Regular key, 2 characters */ scancode = SDL_GetScancodeFromName("F1"); SDLTest_AssertPass("Call to SDL_GetScancodeFromName('F1')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_F1, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_F1, scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_F1, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_F1, scancode); /* Regular key, 3 characters */ scancode = SDL_GetScancodeFromName("End"); SDLTest_AssertPass("Call to SDL_GetScancodeFromName('End')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_END, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_END, scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_END, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_END, scancode); /* Regular key, 4 characters */ scancode = SDL_GetScancodeFromName("Find"); SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Find')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_FIND, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_FIND, scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_FIND, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_FIND, scancode); /* Regular key, several characters */ scancode = SDL_GetScancodeFromName("Backspace"); SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Backspace')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_BACKSPACE, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_BACKSPACE, scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_BACKSPACE, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_BACKSPACE, scancode); /* Regular key, several characters with space */ scancode = SDL_GetScancodeFromName("Keypad Enter"); SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Keypad Enter')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_KP_ENTER, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_KP_ENTER, scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_KP_ENTER, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_KP_ENTER, scancode); /* Regular key, last name in list */ scancode = SDL_GetScancodeFromName("Sleep"); SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Sleep')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_SLEEP, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_SLEEP, scancode); - + SDLTest_AssertCheck(scancode == SDL_SCANCODE_SLEEP, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_SLEEP, scancode); + return TEST_COMPLETED; } -/* +/* * Local helper to check for the invalid scancode error message */ void _checkInvalidNameError() { const char *expectedError = "Parameter 'name' is invalid"; - const char *error; + const char *error; error = SDL_GetError(); SDLTest_AssertPass("Call to SDL_GetError()"); SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, "Validate error message, expected: '%s', got: '%s'", expectedError, error); SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); @@ -615,13 +607,13 @@ _checkInvalidNameError() /** * @brief Check call to SDL_GetScancodeFromName with invalid data - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetScancodeFromName * @sa http://wiki.libsdl.org/moin.cgi/SDL_Keycode */ int keyboard_getScancodeFromNameNegative(void *arg) -{ +{ char *name; SDL_Scancode scancode; @@ -634,13 +626,13 @@ keyboard_getScancodeFromNameNegative(void *arg) SDLTest_Assert(name != NULL, "Check that random name is not NULL"); if (name == NULL) { return TEST_ABORTED; - } + } scancode = SDL_GetScancodeFromName((const char *)name); SDLTest_AssertPass("Call to SDL_GetScancodeFromName('%s')", name); SDL_free(name); SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode); _checkInvalidNameError(); - + /* Zero length string input */ name = ""; scancode = SDL_GetScancodeFromName((const char *)name); @@ -654,7 +646,7 @@ keyboard_getScancodeFromNameNegative(void *arg) SDLTest_AssertPass("Call to SDL_GetScancodeFromName(NULL)"); SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode); _checkInvalidNameError(); - + return TEST_COMPLETED; } @@ -664,58 +656,58 @@ keyboard_getScancodeFromNameNegative(void *arg) /* Keyboard test cases */ static const SDLTest_TestCaseReference keyboardTest1 = - { (SDLTest_TestCaseFp)keyboard_getKeyboardState, "keyboard_getKeyboardState", "Check call to SDL_GetKeyboardState with and without numkeys reference", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getKeyboardState, "keyboard_getKeyboardState", "Check call to SDL_GetKeyboardState with and without numkeys reference", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest2 = - { (SDLTest_TestCaseFp)keyboard_getKeyboardFocus, "keyboard_getKeyboardFocus", "Check call to SDL_GetKeyboardFocus", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getKeyboardFocus, "keyboard_getKeyboardFocus", "Check call to SDL_GetKeyboardFocus", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest3 = - { (SDLTest_TestCaseFp)keyboard_getKeyFromName, "keyboard_getKeyFromName", "Check call to SDL_GetKeyFromName for known, unknown and invalid name", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getKeyFromName, "keyboard_getKeyFromName", "Check call to SDL_GetKeyFromName for known, unknown and invalid name", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest4 = - { (SDLTest_TestCaseFp)keyboard_getKeyFromScancode, "keyboard_getKeyFromScancode", "Check call to SDL_GetKeyFromScancode", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getKeyFromScancode, "keyboard_getKeyFromScancode", "Check call to SDL_GetKeyFromScancode", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest5 = - { (SDLTest_TestCaseFp)keyboard_getKeyName, "keyboard_getKeyName", "Check call to SDL_GetKeyName", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getKeyName, "keyboard_getKeyName", "Check call to SDL_GetKeyName", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest6 = - { (SDLTest_TestCaseFp)keyboard_getSetModState, "keyboard_getSetModState", "Check call to SDL_GetModState and SDL_SetModState", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getSetModState, "keyboard_getSetModState", "Check call to SDL_GetModState and SDL_SetModState", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest7 = - { (SDLTest_TestCaseFp)keyboard_startStopTextInput, "keyboard_startStopTextInput", "Check call to SDL_StartTextInput and SDL_StopTextInput", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_startStopTextInput, "keyboard_startStopTextInput", "Check call to SDL_StartTextInput and SDL_StopTextInput", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest8 = - { (SDLTest_TestCaseFp)keyboard_setTextInputRect, "keyboard_setTextInputRect", "Check call to SDL_SetTextInputRect", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_setTextInputRect, "keyboard_setTextInputRect", "Check call to SDL_SetTextInputRect", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest9 = - { (SDLTest_TestCaseFp)keyboard_setTextInputRectNegative, "keyboard_setTextInputRectNegative", "Check call to SDL_SetTextInputRect with invalid data", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_setTextInputRectNegative, "keyboard_setTextInputRectNegative", "Check call to SDL_SetTextInputRect with invalid data", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest10 = - { (SDLTest_TestCaseFp)keyboard_getScancodeFromKey, "keyboard_getScancodeFromKey", "Check call to SDL_GetScancodeFromKey", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getScancodeFromKey, "keyboard_getScancodeFromKey", "Check call to SDL_GetScancodeFromKey", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest11 = - { (SDLTest_TestCaseFp)keyboard_getScancodeFromName, "keyboard_getScancodeFromName", "Check call to SDL_GetScancodeFromName", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getScancodeFromName, "keyboard_getScancodeFromName", "Check call to SDL_GetScancodeFromName", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest12 = - { (SDLTest_TestCaseFp)keyboard_getScancodeFromNameNegative, "keyboard_getScancodeFromNameNegative", "Check call to SDL_GetScancodeFromName with invalid data", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getScancodeFromNameNegative, "keyboard_getScancodeFromNameNegative", "Check call to SDL_GetScancodeFromName with invalid data", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest13 = - { (SDLTest_TestCaseFp)keyboard_getKeyNameNegative, "keyboard_getKeyNameNegative", "Check call to SDL_GetKeyName with invalid data", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getKeyNameNegative, "keyboard_getKeyNameNegative", "Check call to SDL_GetKeyName with invalid data", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest14 = - { (SDLTest_TestCaseFp)keyboard_getScancodeNameNegative, "keyboard_getScancodeNameNegative", "Check call to SDL_GetScancodeName with invalid data", TEST_ENABLED }; + { (SDLTest_TestCaseFp)keyboard_getScancodeNameNegative, "keyboard_getScancodeNameNegative", "Check call to SDL_GetScancodeName with invalid data", TEST_ENABLED }; /* Sequence of Keyboard test cases */ static const SDLTest_TestCaseReference *keyboardTests[] = { - &keyboardTest1, &keyboardTest2, &keyboardTest3, &keyboardTest4, &keyboardTest5, &keyboardTest6, - &keyboardTest7, &keyboardTest8, &keyboardTest9, &keyboardTest10, &keyboardTest11, &keyboardTest12, - &keyboardTest13, &keyboardTest14, NULL + &keyboardTest1, &keyboardTest2, &keyboardTest3, &keyboardTest4, &keyboardTest5, &keyboardTest6, + &keyboardTest7, &keyboardTest8, &keyboardTest9, &keyboardTest10, &keyboardTest11, &keyboardTest12, + &keyboardTest13, &keyboardTest14, NULL }; /* Keyboard test suite (global) */ SDLTest_TestSuiteReference keyboardTestSuite = { - "Keyboard", - NULL, - keyboardTests, - NULL + "Keyboard", + NULL, + keyboardTests, + NULL }; diff --git a/test/testautomation_main.c b/test/testautomation_main.c index 6a40acc70..f695903c2 100644 --- a/test/testautomation_main.c +++ b/test/testautomation_main.c @@ -11,13 +11,16 @@ /*! - * \brief Tests SDL_Init() and SDL_Quit() + * \brief Tests SDL_Init() and SDL_Quit() of Joystick and Haptic subsystems * \sa * http://wiki.libsdl.org/moin.cgi/SDL_Init * http://wiki.libsdl.org/moin.cgi/SDL_Quit */ -static int main_testInitQuit (void *arg) +static int main_testInitQuitJoystickHaptic (void *arg) { +#if defined SDL_JOYSTICK_DISABLED || defined SDL_HAPTIC_DISABLED + return TEST_SKIPPED; +#else int enabled_subsystems; int initialized_subsystems = SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC; @@ -32,6 +35,7 @@ static int main_testInitQuit (void *arg) SDLTest_AssertCheck( enabled_subsystems == 0, "SDL_Quit should shut down everything (%i)", enabled_subsystems ); return TEST_COMPLETED; +#endif } /*! @@ -42,6 +46,9 @@ static int main_testInitQuit (void *arg) */ static int main_testInitQuitSubSystem (void *arg) { +#if defined SDL_JOYSTICK_DISABLED || defined SDL_HAPTIC_DISABLED || defined SDL_GAMECONTROLLER_DISABLED + return TEST_SKIPPED; +#else int i; int subsystems[] = { SDL_INIT_JOYSTICK, SDL_INIT_HAPTIC, SDL_INIT_GAMECONTROLLER }; @@ -61,11 +68,15 @@ static int main_testInitQuitSubSystem (void *arg) } return TEST_COMPLETED; +#endif } const int joy_and_controller = SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER; static int main_testImpliedJoystickInit (void *arg) { +#if defined SDL_JOYSTICK_DISABLED || defined SDL_GAMECONTROLLER_DISABLED + return TEST_SKIPPED; +#else int initialized_system; // First initialize the controller @@ -76,17 +87,21 @@ static int main_testImpliedJoystickInit (void *arg) initialized_system = SDL_WasInit(joy_and_controller); SDLTest_AssertCheck( (initialized_system & joy_and_controller) == joy_and_controller, "SDL_WasInit() should be true for joystick & controller (%x)", initialized_system ); - // Then quit the controller, and make sure that imlicity also quits the + // Then quit the controller, and make sure that implicitly also quits the // joystick subsystem SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); initialized_system = SDL_WasInit(joy_and_controller); SDLTest_AssertCheck( (initialized_system & joy_and_controller) == 0, "SDL_WasInit() should be false for joystick & controller (%x)", initialized_system ); - return TEST_COMPLETED; + return TEST_COMPLETED; +#endif } static int main_testImpliedJoystickQuit (void *arg) { +#if defined SDL_JOYSTICK_DISABLED || defined SDL_GAMECONTROLLER_DISABLED + return TEST_SKIPPED; +#else int initialized_system; // First initialize the controller and the joystick (explicitly) @@ -106,36 +121,37 @@ static int main_testImpliedJoystickQuit (void *arg) SDL_QuitSubSystem(SDL_INIT_JOYSTICK); - return TEST_COMPLETED; + return TEST_COMPLETED; +#endif } static const SDLTest_TestCaseReference mainTest1 = - { (SDLTest_TestCaseFp)main_testInitQuit, "main_testInitQuit", "Tests SDL_Init/Quit", TEST_ENABLED}; + { (SDLTest_TestCaseFp)main_testInitQuitJoystickHaptic, "main_testInitQuitJoystickHaptic", "Tests SDL_Init/Quit of Joystick and Haptic subsystem", TEST_ENABLED}; static const SDLTest_TestCaseReference mainTest2 = - { (SDLTest_TestCaseFp)main_testInitQuitSubSystem, "main_testInitQuitSubSystem", "Tests SDL_InitSubSystem/QuitSubSystem", TEST_ENABLED}; + { (SDLTest_TestCaseFp)main_testInitQuitSubSystem, "main_testInitQuitSubSystem", "Tests SDL_InitSubSystem/QuitSubSystem", TEST_ENABLED}; static const SDLTest_TestCaseReference mainTest3 = - { (SDLTest_TestCaseFp)main_testImpliedJoystickInit, "main_testImpliedJoystickInit", "Tests that init for gamecontroller properly implies joystick", TEST_ENABLED}; + { (SDLTest_TestCaseFp)main_testImpliedJoystickInit, "main_testImpliedJoystickInit", "Tests that init for gamecontroller properly implies joystick", TEST_ENABLED}; static const SDLTest_TestCaseReference mainTest4 = - { (SDLTest_TestCaseFp)main_testImpliedJoystickQuit, "main_testImpliedJoystickQuit", "Tests that quit for gamecontroller doesn't quit joystick if you inited it explicitly", TEST_ENABLED}; + { (SDLTest_TestCaseFp)main_testImpliedJoystickQuit, "main_testImpliedJoystickQuit", "Tests that quit for gamecontroller doesn't quit joystick if you inited it explicitly", TEST_ENABLED}; /* Sequence of Platform test cases */ static const SDLTest_TestCaseReference *mainTests[] = { - &mainTest1, - &mainTest2, - &mainTest3, - &mainTest4, - NULL + &mainTest1, + &mainTest2, + &mainTest3, + &mainTest4, + NULL }; /* Platform test suite (global) */ SDLTest_TestSuiteReference mainTestSuite = { - "Main", - NULL, - mainTests, - NULL + "Main", + NULL, + mainTests, + NULL }; /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testautomation_mouse.c b/test/testautomation_mouse.c index 69d82dd09..57cadee2e 100644 --- a/test/testautomation_mouse.c +++ b/test/testautomation_mouse.c @@ -13,32 +13,32 @@ /* Test case functions */ /* Helper to evaluate state returned from SDL_GetMouseState */ -int _mouseStateCheck(Uint8 state) +int _mouseStateCheck(Uint32 state) { - return (state == 0) || - (state == SDL_BUTTON(SDL_BUTTON_LEFT)) || - (state == SDL_BUTTON(SDL_BUTTON_MIDDLE)) || - (state == SDL_BUTTON(SDL_BUTTON_RIGHT)) || - (state == SDL_BUTTON(SDL_BUTTON_X1)) || + return (state == 0) || + (state == SDL_BUTTON(SDL_BUTTON_LEFT)) || + (state == SDL_BUTTON(SDL_BUTTON_MIDDLE)) || + (state == SDL_BUTTON(SDL_BUTTON_RIGHT)) || + (state == SDL_BUTTON(SDL_BUTTON_X1)) || (state == SDL_BUTTON(SDL_BUTTON_X2)); } /** * @brief Check call to SDL_GetMouseState - * + * */ int mouse_getMouseState(void *arg) { int x; int y; - Uint8 state; + Uint32 state; /* Pump some events to update mouse state */ SDL_PumpEvents(); SDLTest_AssertPass("Call to SDL_PumpEvents()"); - /* Case where x, y pointer is NULL */ + /* Case where x, y pointer is NULL */ state = SDL_GetMouseState(NULL, NULL); SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, NULL)"); SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state); @@ -65,26 +65,26 @@ mouse_getMouseState(void *arg) SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state); - + return TEST_COMPLETED; } /** * @brief Check call to SDL_GetRelativeMouseState - * + * */ int mouse_getRelativeMouseState(void *arg) { int x; int y; - Uint8 state; + Uint32 state; /* Pump some events to update mouse state */ SDL_PumpEvents(); SDLTest_AssertPass("Call to SDL_PumpEvents()"); - /* Case where x, y pointer is NULL */ + /* Case where x, y pointer is NULL */ state = SDL_GetRelativeMouseState(NULL, NULL); SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, NULL)"); SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state); @@ -111,7 +111,7 @@ mouse_getRelativeMouseState(void *arg) SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %i", state); - + return TEST_COMPLETED; } @@ -191,225 +191,225 @@ static SDL_Cursor *_initArrowCursor(const char *image[]) /** * @brief Check call to SDL_CreateCursor and SDL_FreeCursor - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_CreateCursor * @sa http://wiki.libsdl.org/moin.cgi/SDL_FreeCursor */ int mouse_createFreeCursor(void *arg) { - SDL_Cursor *cursor; + SDL_Cursor *cursor; - /* Create a cursor */ - cursor = _initArrowCursor(_mouseArrowData); + /* Create a cursor */ + cursor = _initArrowCursor(_mouseArrowData); SDLTest_AssertPass("Call to SDL_CreateCursor()"); - SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL"); - if (cursor == NULL) { - return TEST_ABORTED; - } + SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL"); + if (cursor == NULL) { + return TEST_ABORTED; + } - /* Free cursor again */ - SDL_FreeCursor(cursor); - SDLTest_AssertPass("Call to SDL_FreeCursor()"); + /* Free cursor again */ + SDL_FreeCursor(cursor); + SDLTest_AssertPass("Call to SDL_FreeCursor()"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Check call to SDL_CreateColorCursor and SDL_FreeCursor - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_CreateColorCursor * @sa http://wiki.libsdl.org/moin.cgi/SDL_FreeCursor */ int mouse_createFreeColorCursor(void *arg) { - SDL_Surface *face; - SDL_Cursor *cursor; + SDL_Surface *face; + SDL_Cursor *cursor; - /* Get sample surface */ - face = SDLTest_ImageFace(); - SDLTest_AssertCheck(face != NULL, "Validate sample input image is not NULL"); - if (face == NULL) return TEST_ABORTED; - - /* Create a color cursor from surface */ - cursor = SDL_CreateColorCursor(face, 0, 0); + /* Get sample surface */ + face = SDLTest_ImageFace(); + SDLTest_AssertCheck(face != NULL, "Validate sample input image is not NULL"); + if (face == NULL) return TEST_ABORTED; + + /* Create a color cursor from surface */ + cursor = SDL_CreateColorCursor(face, 0, 0); SDLTest_AssertPass("Call to SDL_CreateColorCursor()"); - SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateColorCursor() is not NULL"); - if (cursor == NULL) { - SDL_FreeSurface(face); - return TEST_ABORTED; - } + SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateColorCursor() is not NULL"); + if (cursor == NULL) { + SDL_FreeSurface(face); + return TEST_ABORTED; + } - /* Free cursor again */ - SDL_FreeCursor(cursor); - SDLTest_AssertPass("Call to SDL_FreeCursor()"); + /* Free cursor again */ + SDL_FreeCursor(cursor); + SDLTest_AssertPass("Call to SDL_FreeCursor()"); - /* Clean up */ - SDL_FreeSurface(face); - - return TEST_COMPLETED; + /* Clean up */ + SDL_FreeSurface(face); + + return TEST_COMPLETED; } /* Helper that changes cursor visibility */ void _changeCursorVisibility(int state) { - int oldState; - int newState; - int result; + int oldState; + int newState; + int result; oldState = SDL_ShowCursor(SDL_QUERY); - SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)"); + SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)"); result = SDL_ShowCursor(state); - SDLTest_AssertPass("Call to SDL_ShowCursor(%s)", (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE"); - SDLTest_AssertCheck(result == oldState, "Validate result from SDL_ShowCursor(%s), expected: %i, got: %i", - (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE", oldState, result); - - newState = SDL_ShowCursor(SDL_QUERY); - SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)"); - SDLTest_AssertCheck(state == newState, "Validate new state, expected: %i, got: %i", - state, newState); + SDLTest_AssertPass("Call to SDL_ShowCursor(%s)", (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE"); + SDLTest_AssertCheck(result == oldState, "Validate result from SDL_ShowCursor(%s), expected: %i, got: %i", + (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE", oldState, result); + + newState = SDL_ShowCursor(SDL_QUERY); + SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)"); + SDLTest_AssertCheck(state == newState, "Validate new state, expected: %i, got: %i", + state, newState); } /** * @brief Check call to SDL_ShowCursor - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_ShowCursor */ int mouse_showCursor(void *arg) { - int currentState; + int currentState; - /* Get current state */ - currentState = SDL_ShowCursor(SDL_QUERY); - SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)"); - SDLTest_AssertCheck(currentState == SDL_DISABLE || currentState == SDL_ENABLE, - "Validate result is %i or %i, got: %i", SDL_DISABLE, SDL_ENABLE, currentState); - if (currentState == SDL_DISABLE) { - /* Show the cursor, then hide it again */ - _changeCursorVisibility(SDL_ENABLE); - _changeCursorVisibility(SDL_DISABLE); - } else if (currentState == SDL_ENABLE) { - /* Hide the cursor, then show it again */ - _changeCursorVisibility(SDL_DISABLE); - _changeCursorVisibility(SDL_ENABLE); - } else { - return TEST_ABORTED; - } + /* Get current state */ + currentState = SDL_ShowCursor(SDL_QUERY); + SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)"); + SDLTest_AssertCheck(currentState == SDL_DISABLE || currentState == SDL_ENABLE, + "Validate result is %i or %i, got: %i", SDL_DISABLE, SDL_ENABLE, currentState); + if (currentState == SDL_DISABLE) { + /* Show the cursor, then hide it again */ + _changeCursorVisibility(SDL_ENABLE); + _changeCursorVisibility(SDL_DISABLE); + } else if (currentState == SDL_ENABLE) { + /* Hide the cursor, then show it again */ + _changeCursorVisibility(SDL_DISABLE); + _changeCursorVisibility(SDL_ENABLE); + } else { + return TEST_ABORTED; + } - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Check call to SDL_SetCursor - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_SetCursor */ int mouse_setCursor(void *arg) { - SDL_Cursor *cursor; + SDL_Cursor *cursor; - /* Create a cursor */ - cursor = _initArrowCursor(_mouseArrowData); + /* Create a cursor */ + cursor = _initArrowCursor(_mouseArrowData); SDLTest_AssertPass("Call to SDL_CreateCursor()"); - SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL"); - if (cursor == NULL) { - return TEST_ABORTED; - } + SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL"); + if (cursor == NULL) { + return TEST_ABORTED; + } - /* Set the arrow cursor */ - SDL_SetCursor(cursor); - SDLTest_AssertPass("Call to SDL_SetCursor(cursor)"); + /* Set the arrow cursor */ + SDL_SetCursor(cursor); + SDLTest_AssertPass("Call to SDL_SetCursor(cursor)"); - /* Force redraw */ - SDL_SetCursor(NULL); - SDLTest_AssertPass("Call to SDL_SetCursor(NULL)"); + /* Force redraw */ + SDL_SetCursor(NULL); + SDLTest_AssertPass("Call to SDL_SetCursor(NULL)"); - /* Free cursor again */ - SDL_FreeCursor(cursor); - SDLTest_AssertPass("Call to SDL_FreeCursor()"); + /* Free cursor again */ + SDL_FreeCursor(cursor); + SDLTest_AssertPass("Call to SDL_FreeCursor()"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Check call to SDL_GetCursor - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetCursor */ int mouse_getCursor(void *arg) { - SDL_Cursor *cursor; + SDL_Cursor *cursor; - /* Get current cursor */ - cursor = SDL_GetCursor(); + /* Get current cursor */ + cursor = SDL_GetCursor(); SDLTest_AssertPass("Call to SDL_GetCursor()"); - SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_GetCursor() is not NULL"); + SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_GetCursor() is not NULL"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetRelativeMouseMode * @sa http://wiki.libsdl.org/moin.cgi/SDL_SetRelativeMouseMode */ int mouse_getSetRelativeMouseMode(void *arg) { - int result; + int result; int i; - SDL_bool initialState; - SDL_bool currentState; + SDL_bool initialState; + SDL_bool currentState; - /* Capture original state so we can revert back to it later */ - initialState = SDL_GetRelativeMouseMode(); + /* Capture original state so we can revert back to it later */ + initialState = SDL_GetRelativeMouseMode(); SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); /* Repeat twice to check D->D transition */ for (i=0; i<2; i++) { - /* Disable - should always be supported */ + /* Disable - should always be supported */ result = SDL_SetRelativeMouseMode(SDL_FALSE); SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)"); SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result); - currentState = SDL_GetRelativeMouseMode(); + currentState = SDL_GetRelativeMouseMode(); SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState); } - + /* Repeat twice to check D->E->E transition */ for (i=0; i<2; i++) { - /* Enable - may not be supported */ + /* Enable - may not be supported */ result = SDL_SetRelativeMouseMode(SDL_TRUE); SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(TRUE)"); if (result != -1) { SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result); - currentState = SDL_GetRelativeMouseMode(); + currentState = SDL_GetRelativeMouseMode(); SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); SDLTest_AssertCheck(currentState == SDL_TRUE, "Validate current state is TRUE, got: %i", currentState); } } - /* Disable to check E->D transition */ + /* Disable to check E->D transition */ result = SDL_SetRelativeMouseMode(SDL_FALSE); SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)"); SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result); - currentState = SDL_GetRelativeMouseMode(); + currentState = SDL_GetRelativeMouseMode(); SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState); - - /* Revert to originl state - ignore result */ + + /* Revert to original state - ignore result */ result = SDL_SetRelativeMouseMode(initialState); - return TEST_COMPLETED; + return TEST_COMPLETED; } -#define MOUSE_TESTWINDOW_WIDTH 320 +#define MOUSE_TESTWINDOW_WIDTH 320 #define MOUSE_TESTWINDOW_HEIGHT 200 /** @@ -426,11 +426,11 @@ SDL_Window *_createMouseSuiteTestWindow() } /* - * Destroy test window + * Destroy test window */ void _destroyMouseSuiteTestWindow(SDL_Window *window) { - if (window != NULL) { + if (window != NULL) { SDL_DestroyWindow(window); window = NULL; SDLTest_AssertPass("SDL_DestroyWindow()"); @@ -439,156 +439,156 @@ void _destroyMouseSuiteTestWindow(SDL_Window *window) /** * @brief Check call to SDL_WarpMouseInWindow - * + * * @sa http://wiki.libsdl.org/moin.cgi/SDL_WarpMouseInWindow */ int mouse_warpMouseInWindow(void *arg) { - const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT; - int numPositions = 6; - int xPositions[] = {-1, 0, 1, w-1, w, w+1 }; - int yPositions[] = {-1, 0, 1, h-1, h, h+1 }; - int x, y, i, j; - SDL_Window *window; - - /* Create test window */ - window = _createMouseSuiteTestWindow(); - if (window == NULL) return TEST_ABORTED; + const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT; + int numPositions = 6; + int xPositions[] = {-1, 0, 1, w-1, w, w+1 }; + int yPositions[] = {-1, 0, 1, h-1, h, h+1 }; + int x, y, i, j; + SDL_Window *window; - /* Mouse to random position inside window */ - x = SDLTest_RandomIntegerInRange(1, w-1); - y = SDLTest_RandomIntegerInRange(1, h-1); - SDL_WarpMouseInWindow(window, x, y); - SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); + /* Create test window */ + window = _createMouseSuiteTestWindow(); + if (window == NULL) return TEST_ABORTED; + + /* Mouse to random position inside window */ + x = SDLTest_RandomIntegerInRange(1, w-1); + y = SDLTest_RandomIntegerInRange(1, h-1); + SDL_WarpMouseInWindow(window, x, y); + SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); /* Same position again */ - SDL_WarpMouseInWindow(window, x, y); - SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); + SDL_WarpMouseInWindow(window, x, y); + SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); - /* Mouse to various boundary positions */ - for (i=0; i + +#include "SDL.h" +#include "SDL_test.h" + +/* Test case functions */ + +/* Definition of all RGB formats used to test pixel conversions */ +const int _numRGBPixelFormats = 30; +Uint32 _RGBPixelFormats[] = + { + SDL_PIXELFORMAT_INDEX1LSB, + SDL_PIXELFORMAT_INDEX1MSB, + SDL_PIXELFORMAT_INDEX4LSB, + SDL_PIXELFORMAT_INDEX4MSB, + SDL_PIXELFORMAT_INDEX8, + SDL_PIXELFORMAT_RGB332, + SDL_PIXELFORMAT_RGB444, + SDL_PIXELFORMAT_RGB555, + SDL_PIXELFORMAT_BGR555, + SDL_PIXELFORMAT_ARGB4444, + SDL_PIXELFORMAT_RGBA4444, + SDL_PIXELFORMAT_ABGR4444, + SDL_PIXELFORMAT_BGRA4444, + SDL_PIXELFORMAT_ARGB1555, + SDL_PIXELFORMAT_RGBA5551, + SDL_PIXELFORMAT_ABGR1555, + SDL_PIXELFORMAT_BGRA5551, + SDL_PIXELFORMAT_RGB565, + SDL_PIXELFORMAT_BGR565, + SDL_PIXELFORMAT_RGB24, + SDL_PIXELFORMAT_BGR24, + SDL_PIXELFORMAT_RGB888, + SDL_PIXELFORMAT_RGBX8888, + SDL_PIXELFORMAT_BGR888, + SDL_PIXELFORMAT_BGRX8888, + SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_ARGB2101010 + }; +char* _RGBPixelFormatsVerbose[] = + { + "SDL_PIXELFORMAT_INDEX1LSB", + "SDL_PIXELFORMAT_INDEX1MSB", + "SDL_PIXELFORMAT_INDEX4LSB", + "SDL_PIXELFORMAT_INDEX4MSB", + "SDL_PIXELFORMAT_INDEX8", + "SDL_PIXELFORMAT_RGB332", + "SDL_PIXELFORMAT_RGB444", + "SDL_PIXELFORMAT_RGB555", + "SDL_PIXELFORMAT_BGR555", + "SDL_PIXELFORMAT_ARGB4444", + "SDL_PIXELFORMAT_RGBA4444", + "SDL_PIXELFORMAT_ABGR4444", + "SDL_PIXELFORMAT_BGRA4444", + "SDL_PIXELFORMAT_ARGB1555", + "SDL_PIXELFORMAT_RGBA5551", + "SDL_PIXELFORMAT_ABGR1555", + "SDL_PIXELFORMAT_BGRA5551", + "SDL_PIXELFORMAT_RGB565", + "SDL_PIXELFORMAT_BGR565", + "SDL_PIXELFORMAT_RGB24", + "SDL_PIXELFORMAT_BGR24", + "SDL_PIXELFORMAT_RGB888", + "SDL_PIXELFORMAT_RGBX8888", + "SDL_PIXELFORMAT_BGR888", + "SDL_PIXELFORMAT_BGRX8888", + "SDL_PIXELFORMAT_ARGB8888", + "SDL_PIXELFORMAT_RGBA8888", + "SDL_PIXELFORMAT_ABGR8888", + "SDL_PIXELFORMAT_BGRA8888", + "SDL_PIXELFORMAT_ARGB2101010" + }; + +/* Definition of all Non-RGB formats used to test pixel conversions */ +const int _numNonRGBPixelFormats = 5; +Uint32 _nonRGBPixelFormats[] = + { + SDL_PIXELFORMAT_YV12, + SDL_PIXELFORMAT_IYUV, + SDL_PIXELFORMAT_YUY2, + SDL_PIXELFORMAT_UYVY, + SDL_PIXELFORMAT_YVYU + }; +char* _nonRGBPixelFormatsVerbose[] = + { + "SDL_PIXELFORMAT_YV12", + "SDL_PIXELFORMAT_IYUV", + "SDL_PIXELFORMAT_YUY2", + "SDL_PIXELFORMAT_UYVY", + "SDL_PIXELFORMAT_YVYU" + }; + +/* Definition of some invalid formats for negative tests */ +const int _numInvalidPixelFormats = 2; +Uint32 _invalidPixelFormats[] = + { + 0xfffffffe, + 0xffffffff + }; +char* _invalidPixelFormatsVerbose[] = + { + "SDL_PIXELFORMAT_UNKNOWN", + "SDL_PIXELFORMAT_UNKNOWN" + }; + +/* Test case functions */ + +/** + * @brief Call to SDL_AllocFormat and SDL_FreeFormat + * + * @sa http://wiki.libsdl.org/moin.fcg/SDL_AllocFormat + * @sa http://wiki.libsdl.org/moin.fcg/SDL_FreeFormat + */ +int +pixels_allocFreeFormat(void *arg) +{ + const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN"; + const char *expectedError = "Parameter 'format' is invalid"; + const char *error; + int i; + Uint32 format; + Uint32 masks; + SDL_PixelFormat* result; + + /* Blank/unknown format */ + format = 0; + SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format); + + /* Allocate format */ + result = SDL_AllocFormat(format); + SDLTest_AssertPass("Call to SDL_AllocFormat()"); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format); + SDLTest_AssertCheck(result->BitsPerPixel == 0, "Verify value of result.BitsPerPixel; expected: 0, got %u", result->BitsPerPixel); + SDLTest_AssertCheck(result->BytesPerPixel == 0, "Verify value of result.BytesPerPixel; expected: 0, got %u", result->BytesPerPixel); + masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; + SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %u", masks); + + /* Deallocate again */ + SDL_FreeFormat(result); + SDLTest_AssertPass("Call to SDL_FreeFormat()"); + } + + /* RGB formats */ + for (i = 0; i < _numRGBPixelFormats; i++) { + format = _RGBPixelFormats[i]; + SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format); + + /* Allocate format */ + result = SDL_AllocFormat(format); + SDLTest_AssertPass("Call to SDL_AllocFormat()"); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format); + SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel); + SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel); + if (result->palette != NULL) { + masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; + SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %u", masks); + } + + /* Deallocate again */ + SDL_FreeFormat(result); + SDLTest_AssertPass("Call to SDL_FreeFormat()"); + } + } + + /* Non-RGB formats */ + for (i = 0; i < _numNonRGBPixelFormats; i++) { + format = _nonRGBPixelFormats[i]; + SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format); + + /* Try to allocate format */ + result = SDL_AllocFormat(format); + SDLTest_AssertPass("Call to SDL_AllocFormat()"); + SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); + } + + /* Negative cases */ + + /* Invalid Formats */ + for (i = 0; i < _numInvalidPixelFormats; i++) { + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + format = _invalidPixelFormats[i]; + result = SDL_AllocFormat(format); + SDLTest_AssertPass("Call to SDL_AllocFormat(%u)", format); + SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError, error); + } + } + + /* Invalid free pointer */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + SDL_FreeFormat(NULL); + SDLTest_AssertPass("Call to SDL_FreeFormat(NULL)"); + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError, error); + } + + return TEST_COMPLETED; +} + +/** + * @brief Call to SDL_GetPixelFormatName + * + * @sa http://wiki.libsdl.org/moin.fcg/SDL_GetPixelFormatName + */ +int +pixels_getPixelFormatName(void *arg) +{ + const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN"; + const char *error; + int i; + Uint32 format; + char* result; + + /* Blank/undefined format */ + format = 0; + SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format); + + /* Get name of format */ + result = (char *)SDL_GetPixelFormatName(format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(SDL_strlen(result) > 0, "Verify result is non-empty"); + SDLTest_AssertCheck(SDL_strcmp(result, unknownFormat) == 0, + "Verify result text; expected: %s, got %s", unknownFormat, result); + } + + /* RGB formats */ + for (i = 0; i < _numRGBPixelFormats; i++) { + format = _RGBPixelFormats[i]; + SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format); + + /* Get name of format */ + result = (char *)SDL_GetPixelFormatName(format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(SDL_strlen(result) > 0, "Verify result is non-empty"); + SDLTest_AssertCheck(SDL_strcmp(result, _RGBPixelFormatsVerbose[i]) == 0, + "Verify result text; expected: %s, got %s", _RGBPixelFormatsVerbose[i], result); + } + } + + /* Non-RGB formats */ + for (i = 0; i < _numNonRGBPixelFormats; i++) { + format = _nonRGBPixelFormats[i]; + SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format); + + /* Get name of format */ + result = (char *)SDL_GetPixelFormatName(format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(SDL_strlen(result) > 0, "Verify result is non-empty"); + SDLTest_AssertCheck(SDL_strcmp(result, _nonRGBPixelFormatsVerbose[i]) == 0, + "Verify result text; expected: %s, got %s", _nonRGBPixelFormatsVerbose[i], result); + } + } + + /* Negative cases */ + + /* Invalid Formats */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + for (i = 0; i < _numInvalidPixelFormats; i++) { + format = _invalidPixelFormats[i]; + result = (char *)SDL_GetPixelFormatName(format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%u)", format); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(SDL_strlen(result) > 0, + "Verify result is non-empty; got: %s", result); + SDLTest_AssertCheck(SDL_strcmp(result, _invalidPixelFormatsVerbose[i]) == 0, + "Validate name is UNKNOWN, expected: '%s', got: '%s'", _invalidPixelFormatsVerbose[i], result); + } + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL && SDL_strlen(error) == 0, "Validate that error message is empty"); + } + + return TEST_COMPLETED; +} + +/** + * @brief Call to SDL_AllocPalette and SDL_FreePalette + * + * @sa http://wiki.libsdl.org/moin.fcg/SDL_AllocPalette + * @sa http://wiki.libsdl.org/moin.fcg/SDL_FreePalette + */ +int +pixels_allocFreePalette(void *arg) +{ + const char *expectedError1 = "Parameter 'ncolors' is invalid"; + const char *expectedError2 = "Parameter 'palette' is invalid"; + const char *error; + int variation; + int i; + int ncolors; + SDL_Palette* result; + + /* Allocate palette */ + for (variation = 1; variation <= 3; variation++) { + switch (variation) { + /* Just one color */ + case 1: + ncolors = 1; + break; + /* Two colors */ + case 2: + ncolors = 2; + break; + /* More than two colors */ + case 3: + ncolors = SDLTest_RandomIntegerInRange(8, 16); + break; + } + + result = SDL_AllocPalette(ncolors); + SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(result->ncolors == ncolors, "Verify value of result.ncolors; expected: %u, got %u", ncolors, result->ncolors); + if (result->ncolors > 0) { + SDLTest_AssertCheck(result->colors != NULL, "Verify value of result.colors is not NULL"); + if (result->colors != NULL) { + for(i = 0; i < result->ncolors; i++) { + SDLTest_AssertCheck(result->colors[i].r == 255, "Verify value of result.colors[%d].r; expected: 255, got %u", i, result->colors[i].r); + SDLTest_AssertCheck(result->colors[i].g == 255, "Verify value of result.colors[%d].g; expected: 255, got %u", i, result->colors[i].g); + SDLTest_AssertCheck(result->colors[i].b == 255, "Verify value of result.colors[%d].b; expected: 255, got %u", i, result->colors[i].b); + } + } + } + + /* Deallocate again */ + SDL_FreePalette(result); + SDLTest_AssertPass("Call to SDL_FreePalette()"); + } + } + + /* Negative cases */ + + /* Invalid number of colors */ + for (ncolors = 0; ncolors > -3; ncolors--) { + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + result = SDL_AllocPalette(ncolors); + SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors); + SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError1, error); + } + } + + /* Invalid free pointer */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + SDL_FreePalette(NULL); + SDLTest_AssertPass("Call to SDL_FreePalette(NULL)"); + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError2, error); + } + + return TEST_COMPLETED; +} + +/** + * @brief Call to SDL_CalculateGammaRamp + * + * @sa http://wiki.libsdl.org/moin.fcg/SDL_CalculateGammaRamp + */ +int +pixels_calcGammaRamp(void *arg) +{ + const char *expectedError1 = "Parameter 'gamma' is invalid"; + const char *expectedError2 = "Parameter 'ramp' is invalid"; + const char *error; + float gamma; + Uint16 *ramp; + int variation; + int i; + int changed; + Uint16 magic = 0xbeef; + + /* Allocate temp ramp array and fill with some value*/ + ramp = (Uint16 *)SDL_malloc(256 * sizeof(Uint16)); + SDLTest_AssertCheck(ramp != NULL, "Validate temp ramp array could be allocated"); + if (ramp == NULL) return TEST_ABORTED; + + /* Make call with different gamma values */ + for (variation = 0; variation < 4; variation++) { + switch (variation) { + /* gamma = 0 all black */ + case 0: + gamma = 0.0f; + break; + /* gamma = 1 identity */ + case 1: + gamma = 1.0f; + break; + /* gamma = [0.2,0.8] normal range */ + case 2: + gamma = 0.2f + 0.8f * SDLTest_RandomUnitFloat(); + break; + /* gamma = >1.1 non-standard range */ + case 3: + gamma = 1.1f + SDLTest_RandomUnitFloat(); + break; + } + + /* Make call and check that values were updated */ + for (i = 0; i < 256; i++) ramp[i] = magic; + SDL_CalculateGammaRamp(gamma, ramp); + SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(%f)", gamma); + changed = 0; + for (i = 0; i < 256; i++) if (ramp[i] != magic) changed++; + SDLTest_AssertCheck(changed > 250, "Validate that ramp was calculated; expected: >250 values changed, got: %d values changed", changed); + + /* Additional value checks for some cases */ + i = SDLTest_RandomIntegerInRange(64,192); + switch (variation) { + case 0: + SDLTest_AssertCheck(ramp[i] == 0, "Validate value at position %d; expected: 0, got: %d", i, ramp[i]); + break; + case 1: + SDLTest_AssertCheck(ramp[i] == ((i << 8) | i), "Validate value at position %d; expected: %d, got: %d", i, (i << 8) | i, ramp[i]); + break; + case 2: + case 3: + SDLTest_AssertCheck(ramp[i] > 0, "Validate value at position %d; expected: >0, got: %d", i, ramp[i]); + break; + } + } + + /* Negative cases */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + gamma = -1; + for (i=0; i<256; i++) ramp[i] = magic; + SDL_CalculateGammaRamp(gamma, ramp); + SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(%f)", gamma); + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError1, error); + } + changed = 0; + for (i = 0; i < 256; i++) if (ramp[i] != magic) changed++; + SDLTest_AssertCheck(changed ==0, "Validate that ramp unchanged; expected: 0 values changed got: %d values changed", changed); + + SDL_CalculateGammaRamp(0.5f, NULL); + SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(0.5,NULL)"); + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError2, error); + } + + /* Cleanup */ + SDL_free(ramp); + + + return TEST_COMPLETED; +} + +/* ================= Test References ================== */ + +/* Pixels test cases */ +static const SDLTest_TestCaseReference pixelsTest1 = + { (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_AllocFormat and SDL_FreeFormat", TEST_ENABLED }; + +static const SDLTest_TestCaseReference pixelsTest2 = + { (SDLTest_TestCaseFp)pixels_allocFreePalette, "pixels_allocFreePalette", "Call to SDL_AllocPalette and SDL_FreePalette", TEST_ENABLED }; + +static const SDLTest_TestCaseReference pixelsTest3 = + { (SDLTest_TestCaseFp)pixels_calcGammaRamp, "pixels_calcGammaRamp", "Call to SDL_CalculateGammaRamp", TEST_ENABLED }; + +static const SDLTest_TestCaseReference pixelsTest4 = + { (SDLTest_TestCaseFp)pixels_getPixelFormatName, "pixels_getPixelFormatName", "Call to SDL_GetPixelFormatName", TEST_ENABLED }; + +/* Sequence of Pixels test cases */ +static const SDLTest_TestCaseReference *pixelsTests[] = { + &pixelsTest1, &pixelsTest2, &pixelsTest3, &pixelsTest4, NULL +}; + +/* Pixels test suite (global) */ +SDLTest_TestSuiteReference pixelsTestSuite = { + "Pixels", + NULL, + pixelsTests, + NULL +}; diff --git a/test/testautomation_platform.c b/test/testautomation_platform.c index a77aad280..5ed2abad1 100644 --- a/test/testautomation_platform.c +++ b/test/testautomation_platform.c @@ -504,58 +504,58 @@ int platform_testGetPowerInfo(void *arg) /* Platform test cases */ static const SDLTest_TestCaseReference platformTest1 = - { (SDLTest_TestCaseFp)platform_testTypes, "platform_testTypes", "Tests predefined types", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testTypes, "platform_testTypes", "Tests predefined types", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest2 = - { (SDLTest_TestCaseFp)platform_testEndianessAndSwap, "platform_testEndianessAndSwap", "Tests endianess and swap functions", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testEndianessAndSwap, "platform_testEndianessAndSwap", "Tests endianess and swap functions", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest3 = - { (SDLTest_TestCaseFp)platform_testGetFunctions, "platform_testGetFunctions", "Tests various SDL_GetXYZ functions", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testGetFunctions, "platform_testGetFunctions", "Tests various SDL_GetXYZ functions", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest4 = - { (SDLTest_TestCaseFp)platform_testHasFunctions, "platform_testHasFunctions", "Tests various SDL_HasXYZ functions", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testHasFunctions, "platform_testHasFunctions", "Tests various SDL_HasXYZ functions", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest5 = - { (SDLTest_TestCaseFp)platform_testGetVersion, "platform_testGetVersion", "Tests SDL_GetVersion function", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testGetVersion, "platform_testGetVersion", "Tests SDL_GetVersion function", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest6 = - { (SDLTest_TestCaseFp)platform_testSDLVersion, "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testSDLVersion, "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest7 = - { (SDLTest_TestCaseFp)platform_testDefaultInit, "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testDefaultInit, "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest8 = - { (SDLTest_TestCaseFp)platform_testGetSetClearError, "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testGetSetClearError, "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest9 = - { (SDLTest_TestCaseFp)platform_testSetErrorEmptyInput, "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testSetErrorEmptyInput, "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest10 = - { (SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED}; + { (SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED}; static const SDLTest_TestCaseReference platformTest11 = - { (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED }; + { (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED }; /* Sequence of Platform test cases */ static const SDLTest_TestCaseReference *platformTests[] = { - &platformTest1, - &platformTest2, - &platformTest3, - &platformTest4, - &platformTest5, - &platformTest6, - &platformTest7, - &platformTest8, - &platformTest9, - &platformTest10, - &platformTest11, - NULL + &platformTest1, + &platformTest2, + &platformTest3, + &platformTest4, + &platformTest5, + &platformTest6, + &platformTest7, + &platformTest8, + &platformTest9, + &platformTest10, + &platformTest11, + NULL }; /* Platform test suite (global) */ SDLTest_TestSuiteReference platformTestSuite = { - "Platform", - NULL, - platformTests, - NULL + "Platform", + NULL, + platformTests, + NULL }; diff --git a/test/testautomation_rect.c b/test/testautomation_rect.c index 333c973ed..77a7347e6 100644 --- a/test/testautomation_rect.c +++ b/test/testautomation_rect.c @@ -21,7 +21,7 @@ void _validateIntersectRectAndLineResults( int x1, int y1, int x2, int y2, int x1Ref, int y1Ref, int x2Ref, int y2Ref) { - SDLTest_AssertCheck(intersection == expectedIntersection, + SDLTest_AssertCheck(intersection == expectedIntersection, "Check for correct intersection result: expected %s, got %s intersecting rect (%d,%d,%d,%d) with line (%d,%d - %d,%d)", (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", @@ -45,7 +45,7 @@ void _validateIntersectRectAndLineResults( * \sa * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine */ -int +int rect_testIntersectRectAndLine (void *arg) { SDL_Rect refRect = { 0, 0, 32, 32 }; @@ -107,7 +107,7 @@ rect_testIntersectRectAndLine (void *arg) intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 31, 0, 0, 31); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -116,7 +116,7 @@ rect_testIntersectRectAndLine (void *arg) * \sa * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine */ -int +int rect_testIntersectRectAndLineInside (void *arg) { SDL_Rect refRect = { 0, 0, 32, 32 }; @@ -174,7 +174,7 @@ rect_testIntersectRectAndLineInside (void *arg) intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymax, xmax, ymin); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -183,7 +183,7 @@ rect_testIntersectRectAndLineInside (void *arg) * \sa * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine */ -int +int rect_testIntersectRectAndLineOutside (void *arg) { SDL_Rect refRect = { 0, 0, 32, 32 }; @@ -229,7 +229,7 @@ rect_testIntersectRectAndLineOutside (void *arg) intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); _validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, 0, yBottom, 31, yBottom); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -238,7 +238,7 @@ rect_testIntersectRectAndLineOutside (void *arg) * \sa * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine */ -int +int rect_testIntersectRectAndLineEmpty (void *arg) { SDL_Rect refRect; @@ -246,7 +246,7 @@ rect_testIntersectRectAndLineEmpty (void *arg) int x1, y1, x1Ref, y1Ref; int x2, y2, x2Ref, y2Ref; SDL_bool intersected; - + refRect.x = SDLTest_RandomIntegerInRange(1, 1024); refRect.y = SDLTest_RandomIntegerInRange(1, 1024); refRect.w = 0; @@ -264,7 +264,7 @@ rect_testIntersectRectAndLineEmpty (void *arg) intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); _validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -273,7 +273,7 @@ rect_testIntersectRectAndLineEmpty (void *arg) * \sa * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine */ -int +int rect_testIntersectRectAndLineParam (void *arg) { SDL_Rect rect = { 0, 0, 32, 32 }; @@ -282,10 +282,10 @@ rect_testIntersectRectAndLineParam (void *arg) int x2 = x1; int y2 = 2 * rect.h; SDL_bool intersected; - + intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); SDLTest_AssertCheck(intersected == SDL_TRUE, "Check that intersection result was SDL_TRUE"); - + intersected = SDL_IntersectRectAndLine((SDL_Rect *)NULL, &x1, &y1, &x2, &y2); SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); intersected = SDL_IntersectRectAndLine(&rect, (int *)NULL, &y1, &x2, &y2); @@ -299,21 +299,21 @@ rect_testIntersectRectAndLineParam (void *arg) intersected = SDL_IntersectRectAndLine((SDL_Rect *)NULL, (int *)NULL, (int *)NULL, (int *)NULL, (int *)NULL); SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! * \brief Private helper to check SDL_HasIntersection results */ void _validateHasIntersectionResults( - SDL_bool intersection, SDL_bool expectedIntersection, + SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB) { - SDLTest_AssertCheck(intersection == expectedIntersection, + SDLTest_AssertCheck(intersection == expectedIntersection, "Check intersection result: expected %s, got %s intersecting A (%d,%d,%d,%d) with B (%d,%d,%d,%d)", (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - rectA->x, rectA->y, rectA->w, rectA->h, + rectA->x, rectA->y, rectA->w, rectA->h, rectB->x, rectB->y, rectB->w, rectB->h); SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", @@ -329,15 +329,15 @@ void _validateHasIntersectionResults( * \brief Private helper to check SDL_IntersectRect results */ void _validateIntersectRectResults( - SDL_bool intersection, SDL_bool expectedIntersection, - SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, + SDL_bool intersection, SDL_bool expectedIntersection, + SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, SDL_Rect *result, SDL_Rect *expectedResult) { _validateHasIntersectionResults(intersection, expectedIntersection, rectA, rectB, refRectA, refRectB); if (result && expectedResult) { SDLTest_AssertCheck(result->x == expectedResult->x && result->y == expectedResult->y && result->w == expectedResult->w && result->h == expectedResult->h, "Check that intersection of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was correctly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, + rectA->x, rectA->y, rectA->w, rectA->h, rectB->x, rectB->y, rectB->w, rectB->h, result->x, result->y, result->w, result->h, expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h); @@ -348,7 +348,7 @@ void _validateIntersectRectResults( * \brief Private helper to check SDL_UnionRect results */ void _validateUnionRectResults( - SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, + SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, SDL_Rect *result, SDL_Rect *expectedResult) { SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, @@ -361,7 +361,7 @@ void _validateUnionRectResults( refRectB->x, refRectB->y, refRectB->w, refRectB->h); SDLTest_AssertCheck(result->x == expectedResult->x && result->y == expectedResult->y && result->w == expectedResult->w && result->h == expectedResult->h, "Check that union of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was correctly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, + rectA->x, rectA->y, rectA->w, rectA->h, rectB->x, rectB->y, rectB->w, rectB->h, result->x, result->y, result->w, result->h, expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h); @@ -371,10 +371,10 @@ void _validateUnionRectResults( * \brief Private helper to check SDL_RectEmpty results */ void _validateRectEmptyResults( - SDL_bool empty, SDL_bool expectedEmpty, + SDL_bool empty, SDL_bool expectedEmpty, SDL_Rect *rect, SDL_Rect *refRect) { - SDLTest_AssertCheck(empty == expectedEmpty, + SDLTest_AssertCheck(empty == expectedEmpty, "Check for correct empty result: expected %s, got %s testing (%d,%d,%d,%d)", (expectedEmpty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", @@ -389,10 +389,10 @@ void _validateRectEmptyResults( * \brief Private helper to check SDL_RectEquals results */ void _validateRectEqualsResults( - SDL_bool equals, SDL_bool expectedEquals, + SDL_bool equals, SDL_bool expectedEquals, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB) { - SDLTest_AssertCheck(equals == expectedEquals, + SDLTest_AssertCheck(equals == expectedEquals, "Check for correct equals result: expected %s, got %s testing (%d,%d,%d,%d) and (%d,%d,%d,%d)", (expectedEquals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", (equals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", @@ -433,7 +433,7 @@ int rect_testIntersectRectInside (void *arg) intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectB); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -459,9 +459,9 @@ int rect_testIntersectRectOutside (void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_IntersectRect(&rectA, &rectB, &result); - _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); + _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -490,7 +490,7 @@ int rect_testIntersectRectPartial (void *arg) expectedResult.x = refRectB.x; expectedResult.y = refRectB.y; expectedResult.w = refRectA.w - refRectB.x; - expectedResult.h = refRectA.h - refRectB.y; + expectedResult.h = refRectA.h - refRectB.y; intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); @@ -504,7 +504,7 @@ int rect_testIntersectRectPartial (void *arg) expectedResult.x = refRectB.x; expectedResult.y = refRectB.y; expectedResult.w = 1; - expectedResult.h = refRectB.h; + expectedResult.h = refRectB.h; intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); @@ -518,7 +518,7 @@ int rect_testIntersectRectPartial (void *arg) expectedResult.x = 0; expectedResult.y = refRectB.y; expectedResult.w = 1; - expectedResult.h = refRectB.h; + expectedResult.h = refRectB.h; intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); @@ -532,7 +532,7 @@ int rect_testIntersectRectPartial (void *arg) expectedResult.x = refRectB.x; expectedResult.y = refRectB.y; expectedResult.w = refRectB.w; - expectedResult.h = 1; + expectedResult.h = 1; intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); @@ -546,11 +546,11 @@ int rect_testIntersectRectPartial (void *arg) expectedResult.x = refRectB.x; expectedResult.y = 0; expectedResult.w = refRectB.w; - expectedResult.h = 1; + expectedResult.h = 1; intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -586,7 +586,7 @@ int rect_testIntersectRectPoint (void *arg) refRectA.x = SDLTest_RandomIntegerInRange(1, 100); refRectA.y = SDLTest_RandomIntegerInRange(1, 100); refRectB.x = refRectA.x; - refRectB.y = refRectA.y; + refRectB.y = refRectA.y; refRectB.x += offsetX; refRectB.y += offsetY; rectA = refRectA; @@ -597,7 +597,7 @@ int rect_testIntersectRectPoint (void *arg) } } - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -632,7 +632,7 @@ int rect_testIntersectRectEmpty (void *arg) _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); empty = (SDL_bool)SDL_RectEmpty(&result); SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); - + // Rect B empty result.w = SDLTest_RandomIntegerInRange(1, 100); result.h = SDLTest_RandomIntegerInRange(1, 100); @@ -687,19 +687,19 @@ int rect_testIntersectRectParam(void *arg) // invalid parameter combinations intersection = SDL_IntersectRect((SDL_Rect *)NULL, &rectB, &result); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); + SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); intersection = SDL_IntersectRect(&rectA, (SDL_Rect *)NULL, &result); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2st parameter is NULL"); + SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2st parameter is NULL"); intersection = SDL_IntersectRect(&rectA, &rectB, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 3st parameter is NULL"); + SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 3st parameter is NULL"); intersection = SDL_IntersectRect((SDL_Rect *)NULL, (SDL_Rect *)NULL, &result); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameters are NULL"); + SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameters are NULL"); intersection = SDL_IntersectRect((SDL_Rect *)NULL, &rectB, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 3rd parameters are NULL "); + SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 3rd parameters are NULL "); intersection = SDL_IntersectRect((SDL_Rect *)NULL, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL"); + SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -726,7 +726,7 @@ int rect_testHasIntersectionInside (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -753,7 +753,7 @@ int rect_testHasIntersectionOutside (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -820,7 +820,7 @@ int rect_testHasIntersectionPartial (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -855,7 +855,7 @@ int rect_testHasIntersectionPoint (void *arg) refRectA.x = SDLTest_RandomIntegerInRange(1, 100); refRectA.y = SDLTest_RandomIntegerInRange(1, 100); refRectB.x = refRectA.x; - refRectB.y = refRectA.y; + refRectB.y = refRectA.y; refRectB.x += offsetX; refRectB.y += offsetY; rectA = refRectA; @@ -866,7 +866,7 @@ int rect_testHasIntersectionPoint (void *arg) } } - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -924,7 +924,7 @@ int rect_testHasIntersectionEmpty (void *arg) intersection = SDL_HasIntersection(&rectA, &rectB); _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -941,13 +941,13 @@ int rect_testHasIntersectionParam(void *arg) // invalid parameter combinations intersection = SDL_HasIntersection((SDL_Rect *)NULL, &rectB); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); + SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); intersection = SDL_HasIntersection(&rectA, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2st parameter is NULL"); + SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2st parameter is NULL"); intersection = SDL_HasIntersection((SDL_Rect *)NULL, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL"); + SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -989,35 +989,35 @@ int rect_testEnclosePoints(void *arg) if (newy > maxy) maxy = newy; } } - + // Call function and validate - special case: no result requested anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, (SDL_Rect *)NULL); - SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult, - "Check expected return value %s, got %s", - (expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosedNoResult==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult, + "Check expected return value %s, got %s", + (expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (anyEnclosedNoResult==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); for (i=0; irefRectB.x) ? refRectA.x : refRectB.x; miny = (refRectA.yrefRectB.y) ? refRectA.y : refRectB.y; + maxy = (refRectA.y>refRectB.y) ? refRectA.y : refRectB.y; expectedResult.x = minx; expectedResult.y = miny; expectedResult.w = maxx - minx + 1; @@ -1267,7 +1267,7 @@ int rect_testUnionRectOutside(void *arg) } /* Union outside overlap */ - for (dx = -1; dx < 2; dx++) { + for (dx = -1; dx < 2; dx++) { for (dy = -1; dy < 2; dy++) { if ((dx != 0) || (dy != 0)) { refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); @@ -1291,7 +1291,7 @@ int rect_testUnionRectOutside(void *arg) } } - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -1307,7 +1307,7 @@ int rect_testUnionRectEmpty(void *arg) SDL_Rect expectedResult; SDL_Rect result; - /* A empty */ + /* A empty */ refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); refRectA.w=0; @@ -1321,8 +1321,8 @@ int rect_testUnionRectEmpty(void *arg) rectB = refRectB; SDL_UnionRect(&rectA, &rectB, &result); _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - - /* B empty */ + + /* B empty */ refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); refRectA.w=SDLTest_RandomIntegerInRange(1, 1024); @@ -1337,7 +1337,7 @@ int rect_testUnionRectEmpty(void *arg) SDL_UnionRect(&rectA, &rectB, &result); _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - /* A and B empty */ + /* A and B empty */ refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); refRectA.w=0; @@ -1356,7 +1356,7 @@ int rect_testUnionRectEmpty(void *arg) SDL_UnionRect(&rectA, &rectB, &result); _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -1372,7 +1372,7 @@ int rect_testUnionRectInside(void *arg) SDL_Rect expectedResult; SDL_Rect result; int dx, dy; - + /* Union 1x1 with itself */ refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); @@ -1399,7 +1399,7 @@ int rect_testUnionRectInside(void *arg) _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); /* Union inside with edges modified */ - for (dx = -1; dx < 2; dx++) { + for (dx = -1; dx < 2; dx++) { for (dy = -1; dy < 2; dy++) { if ((dx != 0) || (dy != 0)) { refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); @@ -1410,7 +1410,7 @@ int rect_testUnionRectInside(void *arg) if (dx == -1) refRectB.x++; if ((dx == 1) || (dx == -1)) refRectB.w--; if (dy == -1) refRectB.y++; - if ((dy == 1) || (dy == -1)) refRectB.h--; + if ((dy == 1) || (dy == -1)) refRectB.h--; expectedResult = refRectA; rectA = refRectA; rectB = refRectB; @@ -1420,7 +1420,7 @@ int rect_testUnionRectInside(void *arg) } } - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -1436,19 +1436,19 @@ int rect_testUnionRectParam(void *arg) // invalid parameter combinations SDL_UnionRect((SDL_Rect *)NULL, &rectB, &result); - SDLTest_AssertPass("Check that function returns when 1st parameter is NULL"); + SDLTest_AssertPass("Check that function returns when 1st parameter is NULL"); SDL_UnionRect(&rectA, (SDL_Rect *)NULL, &result); - SDLTest_AssertPass("Check that function returns when 2nd parameter is NULL"); + SDLTest_AssertPass("Check that function returns when 2nd parameter is NULL"); SDL_UnionRect(&rectA, &rectB, (SDL_Rect *)NULL); - SDLTest_AssertPass("Check that function returns when 3rd parameter is NULL"); + SDLTest_AssertPass("Check that function returns when 3rd parameter is NULL"); SDL_UnionRect((SDL_Rect *)NULL, &rectB, (SDL_Rect *)NULL); - SDLTest_AssertPass("Check that function returns when 1st and 3rd parameter are NULL"); + SDLTest_AssertPass("Check that function returns when 1st and 3rd parameter are NULL"); SDL_UnionRect(&rectA, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - SDLTest_AssertPass("Check that function returns when 2nd and 3rd parameter are NULL"); + SDLTest_AssertPass("Check that function returns when 2nd and 3rd parameter are NULL"); SDL_UnionRect((SDL_Rect *)NULL, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - SDLTest_AssertPass("Check that function returns when all parameters are NULL"); + SDLTest_AssertPass("Check that function returns when all parameters are NULL"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -1474,7 +1474,7 @@ int rect_testRectEmpty(void *arg) rect = refRect; result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)&rect); _validateRectEmptyResults(result, expectedResult, &rect, &refRect); - + // Empty case for (w=-1; w<2; w++) { for (h=-1; h<2; h++) { @@ -1491,7 +1491,7 @@ int rect_testRectEmpty(void *arg) } } - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -1506,9 +1506,9 @@ int rect_testRectEmptyParam(void *arg) // invalid parameter combinations result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)NULL); - SDLTest_AssertCheck(result == SDL_TRUE, "Check that function returns TRUE when 1st parameter is NULL"); + SDLTest_AssertCheck(result == SDL_TRUE, "Check that function returns TRUE when 1st parameter is NULL"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -1531,14 +1531,14 @@ int rect_testRectEquals(void *arg) refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); refRectA.w=SDLTest_RandomIntegerInRange(1, 1024); refRectA.h=SDLTest_RandomIntegerInRange(1, 1024); - refRectB = refRectA; + refRectB = refRectA; expectedResult = SDL_TRUE; rectA = refRectA; rectB = refRectB; result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)&rectA, (const SDL_Rect *)&rectB); _validateRectEqualsResults(result, expectedResult, &rectA, &rectB, &refRectA, &refRectB); - return TEST_COMPLETED; + return TEST_COMPLETED; } /*! @@ -1565,13 +1565,13 @@ int rect_testRectEqualsParam(void *arg) // invalid parameter combinations result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)NULL, (const SDL_Rect *)&rectB); - SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); + SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)&rectA, (const SDL_Rect *)NULL); - SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL"); + SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL"); result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)NULL, (const SDL_Rect *)NULL); - SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameter are NULL"); + SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameter are NULL"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /* ================= Test References ================== */ @@ -1580,98 +1580,98 @@ int rect_testRectEqualsParam(void *arg) /* SDL_IntersectRectAndLine */ static const SDLTest_TestCaseReference rectTest1 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLine,"rect_testIntersectRectAndLine", "Tests SDL_IntersectRectAndLine clipping cases", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectAndLine,"rect_testIntersectRectAndLine", "Tests SDL_IntersectRectAndLine clipping cases", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest2 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineInside, "rect_testIntersectRectAndLineInside", "Tests SDL_IntersectRectAndLine with line fully contained in rect", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineInside, "rect_testIntersectRectAndLineInside", "Tests SDL_IntersectRectAndLine with line fully contained in rect", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest3 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineOutside, "rect_testIntersectRectAndLineOutside", "Tests SDL_IntersectRectAndLine with line fully outside of rect", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineOutside, "rect_testIntersectRectAndLineOutside", "Tests SDL_IntersectRectAndLine with line fully outside of rect", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest4 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineEmpty, "rect_testIntersectRectAndLineEmpty", "Tests SDL_IntersectRectAndLine with empty rectangle ", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineEmpty, "rect_testIntersectRectAndLineEmpty", "Tests SDL_IntersectRectAndLine with empty rectangle ", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest5 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineParam, "rect_testIntersectRectAndLineParam", "Negative tests against SDL_IntersectRectAndLine with invalid parameters", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineParam, "rect_testIntersectRectAndLineParam", "Negative tests against SDL_IntersectRectAndLine with invalid parameters", TEST_ENABLED }; /* SDL_IntersectRect */ static const SDLTest_TestCaseReference rectTest6 = - { (SDLTest_TestCaseFp)rect_testIntersectRectInside, "rect_testIntersectRectInside", "Tests SDL_IntersectRect with B fully contained in A", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectInside, "rect_testIntersectRectInside", "Tests SDL_IntersectRect with B fully contained in A", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest7 = - { (SDLTest_TestCaseFp)rect_testIntersectRectOutside, "rect_testIntersectRectOutside", "Tests SDL_IntersectRect with B fully outside of A", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectOutside, "rect_testIntersectRectOutside", "Tests SDL_IntersectRect with B fully outside of A", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest8 = - { (SDLTest_TestCaseFp)rect_testIntersectRectPartial, "rect_testIntersectRectPartial", "Tests SDL_IntersectRect with B partially intersecting A", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectPartial, "rect_testIntersectRectPartial", "Tests SDL_IntersectRect with B partially intersecting A", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest9 = - { (SDLTest_TestCaseFp)rect_testIntersectRectPoint, "rect_testIntersectRectPoint", "Tests SDL_IntersectRect with 1x1 sized rectangles", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectPoint, "rect_testIntersectRectPoint", "Tests SDL_IntersectRect with 1x1 sized rectangles", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest10 = - { (SDLTest_TestCaseFp)rect_testIntersectRectEmpty, "rect_testIntersectRectEmpty", "Tests SDL_IntersectRect with empty rectangles", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectEmpty, "rect_testIntersectRectEmpty", "Tests SDL_IntersectRect with empty rectangles", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest11 = - { (SDLTest_TestCaseFp)rect_testIntersectRectParam, "rect_testIntersectRectParam", "Negative tests against SDL_IntersectRect with invalid parameters", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testIntersectRectParam, "rect_testIntersectRectParam", "Negative tests against SDL_IntersectRect with invalid parameters", TEST_ENABLED }; /* SDL_HasIntersection */ static const SDLTest_TestCaseReference rectTest12 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionInside, "rect_testHasIntersectionInside", "Tests SDL_HasIntersection with B fully contained in A", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testHasIntersectionInside, "rect_testHasIntersectionInside", "Tests SDL_HasIntersection with B fully contained in A", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest13 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionOutside, "rect_testHasIntersectionOutside", "Tests SDL_HasIntersection with B fully outside of A", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testHasIntersectionOutside, "rect_testHasIntersectionOutside", "Tests SDL_HasIntersection with B fully outside of A", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest14 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionPartial,"rect_testHasIntersectionPartial", "Tests SDL_HasIntersection with B partially intersecting A", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testHasIntersectionPartial,"rect_testHasIntersectionPartial", "Tests SDL_HasIntersection with B partially intersecting A", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest15 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionPoint, "rect_testHasIntersectionPoint", "Tests SDL_HasIntersection with 1x1 sized rectangles", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testHasIntersectionPoint, "rect_testHasIntersectionPoint", "Tests SDL_HasIntersection with 1x1 sized rectangles", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest16 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionEmpty, "rect_testHasIntersectionEmpty", "Tests SDL_HasIntersection with empty rectangles", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testHasIntersectionEmpty, "rect_testHasIntersectionEmpty", "Tests SDL_HasIntersection with empty rectangles", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest17 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionParam, "rect_testHasIntersectionParam", "Negative tests against SDL_HasIntersection with invalid parameters", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testHasIntersectionParam, "rect_testHasIntersectionParam", "Negative tests against SDL_HasIntersection with invalid parameters", TEST_ENABLED }; /* SDL_EnclosePoints */ static const SDLTest_TestCaseReference rectTest18 = - { (SDLTest_TestCaseFp)rect_testEnclosePoints, "rect_testEnclosePoints", "Tests SDL_EnclosePoints without clipping", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testEnclosePoints, "rect_testEnclosePoints", "Tests SDL_EnclosePoints without clipping", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest19 = - { (SDLTest_TestCaseFp)rect_testEnclosePointsWithClipping, "rect_testEnclosePointsWithClipping", "Tests SDL_EnclosePoints with clipping", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testEnclosePointsWithClipping, "rect_testEnclosePointsWithClipping", "Tests SDL_EnclosePoints with clipping", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest20 = - { (SDLTest_TestCaseFp)rect_testEnclosePointsRepeatedInput, "rect_testEnclosePointsRepeatedInput", "Tests SDL_EnclosePoints with repeated input", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testEnclosePointsRepeatedInput, "rect_testEnclosePointsRepeatedInput", "Tests SDL_EnclosePoints with repeated input", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest21 = - { (SDLTest_TestCaseFp)rect_testEnclosePointsParam, "rect_testEnclosePointsParam", "Negative tests against SDL_EnclosePoints with invalid parameters", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testEnclosePointsParam, "rect_testEnclosePointsParam", "Negative tests against SDL_EnclosePoints with invalid parameters", TEST_ENABLED }; /* SDL_UnionRect */ static const SDLTest_TestCaseReference rectTest22 = - { (SDLTest_TestCaseFp)rect_testUnionRectInside, "rect_testUnionRectInside", "Tests SDL_UnionRect where rect B is inside rect A", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testUnionRectInside, "rect_testUnionRectInside", "Tests SDL_UnionRect where rect B is inside rect A", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest23 = - { (SDLTest_TestCaseFp)rect_testUnionRectOutside, "rect_testUnionRectOutside", "Tests SDL_UnionRect where rect B is outside rect A", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testUnionRectOutside, "rect_testUnionRectOutside", "Tests SDL_UnionRect where rect B is outside rect A", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest24 = - { (SDLTest_TestCaseFp)rect_testUnionRectEmpty, "rect_testUnionRectEmpty", "Tests SDL_UnionRect where rect A or rect B are empty", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testUnionRectEmpty, "rect_testUnionRectEmpty", "Tests SDL_UnionRect where rect A or rect B are empty", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest25 = - { (SDLTest_TestCaseFp)rect_testUnionRectParam, "rect_testUnionRectParam", "Negative tests against SDL_UnionRect with invalid parameters", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testUnionRectParam, "rect_testUnionRectParam", "Negative tests against SDL_UnionRect with invalid parameters", TEST_ENABLED }; /* SDL_RectEmpty */ static const SDLTest_TestCaseReference rectTest26 = - { (SDLTest_TestCaseFp)rect_testRectEmpty, "rect_testRectEmpty", "Tests SDL_RectEmpty with various inputs", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testRectEmpty, "rect_testRectEmpty", "Tests SDL_RectEmpty with various inputs", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest27 = - { (SDLTest_TestCaseFp)rect_testRectEmptyParam, "rect_testRectEmptyParam", "Negative tests against SDL_RectEmpty with invalid parameters", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testRectEmptyParam, "rect_testRectEmptyParam", "Negative tests against SDL_RectEmpty with invalid parameters", TEST_ENABLED }; /* SDL_RectEquals */ static const SDLTest_TestCaseReference rectTest28 = - { (SDLTest_TestCaseFp)rect_testRectEquals, "rect_testRectEquals", "Tests SDL_RectEquals with various inputs", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testRectEquals, "rect_testRectEquals", "Tests SDL_RectEquals with various inputs", TEST_ENABLED }; static const SDLTest_TestCaseReference rectTest29 = - { (SDLTest_TestCaseFp)rect_testRectEqualsParam, "rect_testRectEqualsParam", "Negative tests against SDL_RectEquals with invalid parameters", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rect_testRectEqualsParam, "rect_testRectEqualsParam", "Negative tests against SDL_RectEquals with invalid parameters", TEST_ENABLED }; /*! @@ -1681,16 +1681,16 @@ static const SDLTest_TestCaseReference rectTest29 = * http://wiki.libsdl.org/moin.cgi/CategoryRect */ static const SDLTest_TestCaseReference *rectTests[] = { - &rectTest1, &rectTest2, &rectTest3, &rectTest4, &rectTest5, &rectTest6, &rectTest7, &rectTest8, &rectTest9, &rectTest10, &rectTest11, &rectTest12, &rectTest13, &rectTest14, - &rectTest15, &rectTest16, &rectTest17, &rectTest18, &rectTest19, &rectTest20, &rectTest21, &rectTest22, &rectTest23, &rectTest24, &rectTest25, &rectTest26, &rectTest27, - &rectTest28, &rectTest29, NULL + &rectTest1, &rectTest2, &rectTest3, &rectTest4, &rectTest5, &rectTest6, &rectTest7, &rectTest8, &rectTest9, &rectTest10, &rectTest11, &rectTest12, &rectTest13, &rectTest14, + &rectTest15, &rectTest16, &rectTest17, &rectTest18, &rectTest19, &rectTest20, &rectTest21, &rectTest22, &rectTest23, &rectTest24, &rectTest25, &rectTest26, &rectTest27, + &rectTest28, &rectTest29, NULL }; /* Rect test suite (global) */ SDLTest_TestSuiteReference rectTestSuite = { - "Rect", - NULL, - rectTests, - NULL + "Rect", + NULL, + rectTests, + NULL }; diff --git a/test/testautomation_render.c b/test/testautomation_render.c index e33cd064c..d582cb07c 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -19,8 +19,8 @@ #define RENDER_COMPARE_GMASK 0x0000ff00 /**< Green bit mask. */ #define RENDER_COMPARE_BMASK 0x000000ff /**< Blue bit mask. */ -#define ALLOWABLE_ERROR_OPAQUE 0 -#define ALLOWABLE_ERROR_BLENDED 64 +#define ALLOWABLE_ERROR_OPAQUE 0 +#define ALLOWABLE_ERROR_BLENDED 64 /* Test window and renderer */ SDL_Window *window = NULL; @@ -50,7 +50,7 @@ void InitCreateRenderer(void *arg) if (window == NULL) { return; } - + renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); SDLTest_AssertPass("SDL_CreateRenderer()"); SDLTest_AssertCheck(renderer != 0, "Check SDL_CreateRenderer result"); @@ -61,17 +61,17 @@ void InitCreateRenderer(void *arg) } /* - * Destroy renderer for tests + * Destroy renderer for tests */ void CleanupDestroyRenderer(void *arg) { - if (renderer != NULL) { + if (renderer != NULL) { SDL_DestroyRenderer(renderer); renderer = NULL; SDLTest_AssertPass("SDL_DestroyRenderer()"); } - - if (window != NULL) { + + if (window != NULL) { SDL_DestroyWindow(window); window = NULL; SDLTest_AssertPass("SDL_DestroyWindow"); @@ -113,7 +113,7 @@ int render_testPrimitives (void *arg) int checkFailCount1; int checkFailCount2; - /* Need drawcolour or just skip test. */ + /* Need drawcolor or just skip test. */ SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor"); /* Draw a rectangle. */ @@ -216,7 +216,7 @@ int render_testPrimitivesBlend (void *arg) int checkFailCount2; int checkFailCount3; - /* Need drawcolour and blendmode or just skip test. */ + /* Need drawcolor and blendmode or just skip test. */ SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor"); SDLTest_AssertCheck(_hasBlendModes(), "_hasBlendModes"); @@ -288,7 +288,7 @@ int render_testPrimitivesBlend (void *arg) SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1); SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetRenderDrawBlendMode, expected: 0, got: %i", checkFailCount2); SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_RenderDrawLine, expected: 0, got: %i", checkFailCount3); - + checkFailCount1 = 0; checkFailCount2 = 0; checkFailCount3 = 0; @@ -323,7 +323,7 @@ int render_testPrimitivesBlend (void *arg) ret = SDL_RenderDrawPoint(renderer, i, j ); if (ret != 0) checkFailCount3++; } - } + } SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetRenderDrawColor, expected: 0, got: %i", checkFailCount1); SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetRenderDrawBlendMode, expected: 0, got: %i", checkFailCount2); SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_RenderDrawPoint, expected: 0, got: %i", checkFailCount3); @@ -363,7 +363,7 @@ render_testBlit(void *arg) int checkFailCount1; - /* Need drawcolour or just skip test. */ + /* Need drawcolor or just skip test. */ SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor)"); /* Create face surface. */ @@ -410,7 +410,7 @@ render_testBlit(void *arg) /** - * @brief Blits doing colour tests. + * @brief Blits doing color tests. * * \sa * http://wiki.libsdl.org/moin.cgi/SDL_SetTextureColorMod @@ -445,12 +445,12 @@ render_testBlitColor (void *arg) ni = TESTRENDER_SCREEN_W - tw; nj = TESTRENDER_SCREEN_H - th; - /* Test blitting with colour mod. */ + /* Test blitting with color mod. */ checkFailCount1 = 0; checkFailCount2 = 0; for (j=0; j <= nj; j+=4) { for (i=0; i <= ni; i+=4) { - /* Set colour mod. */ + /* Set color mod. */ ret = SDL_SetTextureColorMod( tface, (255/nj)*j, (255/ni)*i, (255/nj)*j ); if (ret != 0) checkFailCount1++; @@ -533,7 +533,7 @@ render_testBlitAlpha (void *arg) ret = SDL_RenderCopy(renderer, tface, NULL, &rect ); if (ret != 0) checkFailCount2++; } - } + } SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureAlphaMod, expected: 0, got: %i", checkFailCount1); SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderCopy, expected: 0, got: %i", checkFailCount2); @@ -654,12 +654,12 @@ render_testBlitBlend (void *arg) /* Test None. */ _testBlitBlendMode( tface, SDL_BLENDMODE_NONE ); referenceSurface = SDLTest_ImageBlitBlendNone(); - _compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE ); + _compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE ); if (referenceSurface != NULL) { SDL_FreeSurface(referenceSurface); referenceSurface = NULL; } - + /* Test Blend. */ _testBlitBlendMode( tface, SDL_BLENDMODE_BLEND ); referenceSurface = SDLTest_ImageBlitBlend(); @@ -698,7 +698,7 @@ render_testBlitBlend (void *arg) for (j=0; j <= nj; j+=4) { for (i=0; i <= ni; i+=4) { - /* Set colour mod. */ + /* Set color mod. */ ret = SDL_SetTextureColorMod( tface, (255/nj)*j, (255/ni)*i, (255/nj)*j ); if (ret != 0) checkFailCount1++; @@ -752,7 +752,7 @@ _isSupported( int code ) } /** - * @brief Test to see if we can vary the draw colour. Helper function. + * @brief Test to see if we can vary the draw color. Helper function. * * \sa * http://wiki.libsdl.org/moin.cgi/SDL_SetRenderDrawColor @@ -766,14 +766,14 @@ _hasDrawColor (void) fail = 0; - /* Set colour. */ + /* Set color. */ ret = SDL_SetRenderDrawColor(renderer, 100, 100, 100, 100 ); if (!_isSupported(ret)) fail = 1; ret = SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a ); if (!_isSupported(ret)) fail = 1; - + /* Restore natural. */ ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE ); if (!_isSupported(ret)) @@ -782,7 +782,7 @@ _hasDrawColor (void) /* Something failed, consider not available. */ if (fail) return 0; - + /* Not set properly, consider failed. */ else if ((r != 100) || (g != 100) || (b != 100) || (a != 100)) return 0; @@ -862,7 +862,7 @@ _loadTestFace(void) if (face == NULL) { return NULL; } - + tface = SDL_CreateTextureFromSurface(renderer, face); if (tface == NULL) { SDLTest_LogError("SDL_CreateTextureFromSurface() failed with error: %s", SDL_GetError()); @@ -875,7 +875,7 @@ _loadTestFace(void) /** - * @brief Test to see if can set texture colour mode. Helper function. + * @brief Test to see if can set texture color mode. Helper function. * * \sa * http://wiki.libsdl.org/moin.cgi/SDL_SetTextureColorMod @@ -957,9 +957,7 @@ _hasTexAlpha(void) /** * @brief Compares screen pixels with image pixels. Helper function. * - * @param msg Message on failure. * @param s Image to compare against. - * @return 0 on success. * * \sa * http://wiki.libsdl.org/moin.cgi/SDL_RenderReadPixels @@ -998,7 +996,7 @@ _compare(SDL_Surface *referenceSurface, int allowable_error) /* Clean up. */ if (pixels != NULL) { - SDL_free(pixels); + SDL_free(pixels); } if (testSurface != NULL) { SDL_FreeSurface(testSurface); @@ -1018,7 +1016,7 @@ _clearScreen(void) { int ret; - /* Set colour. */ + /* Set color. */ ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE ); SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret); @@ -1040,35 +1038,38 @@ _clearScreen(void) /* Render test cases */ static const SDLTest_TestCaseReference renderTest1 = - { (SDLTest_TestCaseFp)render_testGetNumRenderDrivers, "render_testGetNumRenderDrivers", "Tests call to SDL_GetNumRenderDrivers", TEST_ENABLED }; + { (SDLTest_TestCaseFp)render_testGetNumRenderDrivers, "render_testGetNumRenderDrivers", "Tests call to SDL_GetNumRenderDrivers", TEST_ENABLED }; static const SDLTest_TestCaseReference renderTest2 = - { (SDLTest_TestCaseFp)render_testPrimitives, "render_testPrimitives", "Tests rendering primitives", TEST_ENABLED }; + { (SDLTest_TestCaseFp)render_testPrimitives, "render_testPrimitives", "Tests rendering primitives", TEST_ENABLED }; +/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference renderTest3 = - { (SDLTest_TestCaseFp)render_testPrimitivesBlend, "render_testPrimitivesBlend", "Tests rendering primitives with blending", TEST_ENABLED }; + { (SDLTest_TestCaseFp)render_testPrimitivesBlend, "render_testPrimitivesBlend", "Tests rendering primitives with blending", TEST_DISABLED }; static const SDLTest_TestCaseReference renderTest4 = - { (SDLTest_TestCaseFp)render_testBlit, "render_testBlit", "Tests blitting", TEST_ENABLED }; + { (SDLTest_TestCaseFp)render_testBlit, "render_testBlit", "Tests blitting", TEST_ENABLED }; static const SDLTest_TestCaseReference renderTest5 = - { (SDLTest_TestCaseFp)render_testBlitColor, "render_testBlitColor", "Tests blitting with color", TEST_ENABLED }; + { (SDLTest_TestCaseFp)render_testBlitColor, "render_testBlitColor", "Tests blitting with color", TEST_ENABLED }; +/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference renderTest6 = - { (SDLTest_TestCaseFp)render_testBlitAlpha, "render_testBlitAlpha", "Tests blitting with alpha", TEST_ENABLED }; + { (SDLTest_TestCaseFp)render_testBlitAlpha, "render_testBlitAlpha", "Tests blitting with alpha", TEST_DISABLED }; +/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference renderTest7 = - { (SDLTest_TestCaseFp)render_testBlitBlend, "render_testBlitBlend", "Tests blitting with blending", TEST_ENABLED }; + { (SDLTest_TestCaseFp)render_testBlitBlend, "render_testBlitBlend", "Tests blitting with blending", TEST_DISABLED }; /* Sequence of Render test cases */ static const SDLTest_TestCaseReference *renderTests[] = { - &renderTest1, &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, NULL + &renderTest1, &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, NULL }; /* Render test suite (global) */ SDLTest_TestSuiteReference renderTestSuite = { - "Render", - InitCreateRenderer, - renderTests, - CleanupDestroyRenderer + "Render", + InitCreateRenderer, + renderTests, + CleanupDestroyRenderer }; diff --git a/test/testautomation_rwops.c b/test/testautomation_rwops.c index be93809db..f536d8b8b 100644 --- a/test/testautomation_rwops.c +++ b/test/testautomation_rwops.c @@ -32,56 +32,56 @@ static const char RWopsAlphabetString[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; void RWopsSetUp(void *arg) { - int fileLen; - FILE *handle; - int writtenLen; - int result; + int fileLen; + FILE *handle; + int writtenLen; + int result; - /* Clean up from previous runs (if any); ignore errors */ - remove(RWopsReadTestFilename); - remove(RWopsWriteTestFilename); - remove(RWopsAlphabetFilename); + /* Clean up from previous runs (if any); ignore errors */ + remove(RWopsReadTestFilename); + remove(RWopsWriteTestFilename); + remove(RWopsAlphabetFilename); - /* Create a test file */ - handle = fopen(RWopsReadTestFilename, "w"); - SDLTest_AssertCheck(handle != NULL, "Verify creation of file '%s' returned non NULL handle", RWopsReadTestFilename); + /* Create a test file */ + handle = fopen(RWopsReadTestFilename, "w"); + SDLTest_AssertCheck(handle != NULL, "Verify creation of file '%s' returned non NULL handle", RWopsReadTestFilename); if (handle == NULL) return; - /* Write some known text into it */ - fileLen = SDL_strlen(RWopsHelloWorldTestString); - writtenLen = (int)fwrite(RWopsHelloWorldTestString, 1, fileLen, handle); - SDLTest_AssertCheck(fileLen == writtenLen, "Verify number of written bytes, expected %i, got %i", fileLen, writtenLen); - result = fclose(handle); - SDLTest_AssertCheck(result == 0, "Verify result from fclose, expected 0, got %i", result); + /* Write some known text into it */ + fileLen = SDL_strlen(RWopsHelloWorldTestString); + writtenLen = (int)fwrite(RWopsHelloWorldTestString, 1, fileLen, handle); + SDLTest_AssertCheck(fileLen == writtenLen, "Verify number of written bytes, expected %i, got %i", fileLen, writtenLen); + result = fclose(handle); + SDLTest_AssertCheck(result == 0, "Verify result from fclose, expected 0, got %i", result); - /* Create a second test file */ - handle = fopen(RWopsAlphabetFilename, "w"); - SDLTest_AssertCheck(handle != NULL, "Verify creation of file '%s' returned non NULL handle", RWopsAlphabetFilename); + /* Create a second test file */ + handle = fopen(RWopsAlphabetFilename, "w"); + SDLTest_AssertCheck(handle != NULL, "Verify creation of file '%s' returned non NULL handle", RWopsAlphabetFilename); if (handle == NULL) return; - /* Write alphabet text into it */ - fileLen = SDL_strlen(RWopsAlphabetString); - writtenLen = (int)fwrite(RWopsAlphabetString, 1, fileLen, handle); - SDLTest_AssertCheck(fileLen == writtenLen, "Verify number of written bytes, expected %i, got %i", fileLen, writtenLen); - result = fclose(handle); - SDLTest_AssertCheck(result == 0, "Verify result from fclose, expected 0, got %i", result); + /* Write alphabet text into it */ + fileLen = SDL_strlen(RWopsAlphabetString); + writtenLen = (int)fwrite(RWopsAlphabetString, 1, fileLen, handle); + SDLTest_AssertCheck(fileLen == writtenLen, "Verify number of written bytes, expected %i, got %i", fileLen, writtenLen); + result = fclose(handle); + SDLTest_AssertCheck(result == 0, "Verify result from fclose, expected 0, got %i", result); - SDLTest_AssertPass("Creation of test file completed"); + SDLTest_AssertPass("Creation of test file completed"); } void RWopsTearDown(void *arg) { - int result; - - /* Remove the created files to clean up; ignore errors for write filename */ - result = remove(RWopsReadTestFilename); - SDLTest_AssertCheck(result == 0, "Verify result from remove(%s), expected 0, got %i", RWopsReadTestFilename, result); - remove(RWopsWriteTestFilename); - result = remove(RWopsAlphabetFilename); - SDLTest_AssertCheck(result == 0, "Verify result from remove(%s), expected 0, got %i", RWopsAlphabetFilename, result); + int result; - SDLTest_AssertPass("Cleanup of test files completed"); + /* Remove the created files to clean up; ignore errors for write filename */ + result = remove(RWopsReadTestFilename); + SDLTest_AssertCheck(result == 0, "Verify result from remove(%s), expected 0, got %i", RWopsReadTestFilename, result); + remove(RWopsWriteTestFilename); + result = remove(RWopsAlphabetFilename); + SDLTest_AssertCheck(result == 0, "Verify result from remove(%s), expected 0, got %i", RWopsAlphabetFilename, result); + + SDLTest_AssertPass("Cleanup of test files completed"); } /** @@ -91,7 +91,7 @@ RWopsTearDown(void *arg) * http://wiki.libsdl.org/moin.cgi/SDL_RWseek * http://wiki.libsdl.org/moin.cgi/SDL_RWread */ -void +void _testGenericRWopsValidations(SDL_RWops *rw, int write) { char buf[sizeof(RWopsHelloWorldTestString)]; @@ -111,10 +111,10 @@ _testGenericRWopsValidations(SDL_RWops *rw, int write) s = SDL_RWwrite(rw, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1, 1); SDLTest_AssertPass("Call to SDL_RWwrite succeeded"); if (write) { - SDLTest_AssertCheck(s == (size_t)1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", s); + SDLTest_AssertCheck(s == (size_t)1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", s); } else { - SDLTest_AssertCheck(s == (size_t)0, "Verify result of writing with SDL_RWwrite, expected: 0, got %i", s); + SDLTest_AssertCheck(s == (size_t)0, "Verify result of writing with SDL_RWwrite, expected: 0, got %i", s); } /* Test seek to random position */ @@ -131,38 +131,38 @@ _testGenericRWopsValidations(SDL_RWops *rw, int write) s = SDL_RWread( rw, buf, 1, sizeof(RWopsHelloWorldTestString)-1 ); SDLTest_AssertPass("Call to SDL_RWread succeeded"); SDLTest_AssertCheck( - s == (size_t)(sizeof(RWopsHelloWorldTestString)-1), - "Verify result from SDL_RWread, expected %i, got %i", - sizeof(RWopsHelloWorldTestString)-1, - s); + s == (size_t)(sizeof(RWopsHelloWorldTestString)-1), + "Verify result from SDL_RWread, expected %i, got %i", + sizeof(RWopsHelloWorldTestString)-1, + s); SDLTest_AssertCheck( - SDL_memcmp(buf, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1 ) == 0, - "Verify read bytes match expected string, expected '%s', got '%s'", RWopsHelloWorldTestString, buf); + SDL_memcmp(buf, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1 ) == 0, + "Verify read bytes match expected string, expected '%s', got '%s'", RWopsHelloWorldTestString, buf); /* More seek tests. */ i = SDL_RWseek( rw, -4, RW_SEEK_CUR ); SDLTest_AssertPass("Call to SDL_RWseek(...,-4,RW_SEEK_CUR) succeeded"); SDLTest_AssertCheck( - i == (Sint64)(sizeof(RWopsHelloWorldTestString)-5), - "Verify seek to -4 with SDL_RWseek (RW_SEEK_CUR), expected %i, got %i", - sizeof(RWopsHelloWorldTestString)-5, - i); + i == (Sint64)(sizeof(RWopsHelloWorldTestString)-5), + "Verify seek to -4 with SDL_RWseek (RW_SEEK_CUR), expected %i, got %i", + sizeof(RWopsHelloWorldTestString)-5, + i); i = SDL_RWseek( rw, -1, RW_SEEK_END ); SDLTest_AssertPass("Call to SDL_RWseek(...,-1,RW_SEEK_END) succeeded"); SDLTest_AssertCheck( - i == (Sint64)(sizeof(RWopsHelloWorldTestString)-2), - "Verify seek to -1 with SDL_RWseek (RW_SEEK_END), expected %i, got %i", - sizeof(RWopsHelloWorldTestString)-2, - i); - + i == (Sint64)(sizeof(RWopsHelloWorldTestString)-2), + "Verify seek to -1 with SDL_RWseek (RW_SEEK_END), expected %i, got %i", + sizeof(RWopsHelloWorldTestString)-2, + i); + /* Invalid whence seek */ i = SDL_RWseek( rw, 0, 999 ); SDLTest_AssertPass("Call to SDL_RWseek(...,0,invalid_whence) succeeded"); SDLTest_AssertCheck( - i == (Sint64)(-1), - "Verify seek with SDL_RWseek (invalid_whence); expected: -1, got %i", - i); + i == (Sint64)(-1), + "Verify seek with SDL_RWseek (invalid_whence); expected: -1, got %i", + i); } /*! @@ -258,7 +258,7 @@ rwops_testMem (void) * http://wiki.libsdl.org/moin.cgi/SDL_RWFromConstMem * http://wiki.libsdl.org/moin.cgi/SDL_RWClose */ -int +int rwops_testConstMem (void) { SDL_RWops *rw; @@ -311,15 +311,15 @@ rwops_testFileRead(void) /* Check type */ #if defined(ANDROID) SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, + rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type); #elif defined(__WIN32__) SDLTest_AssertCheck( - rw->type == SDL_RWOPS_WINFILE, + rw->type == SDL_RWOPS_WINFILE, "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type); #else SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE, + rw->type == SDL_RWOPS_STDFILE, "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type); #endif @@ -358,15 +358,15 @@ rwops_testFileWrite(void) /* Check type */ #if defined(ANDROID) SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, + rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type); #elif defined(__WIN32__) SDLTest_AssertCheck( - rw->type == SDL_RWOPS_WINFILE, + rw->type == SDL_RWOPS_WINFILE, "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type); #else SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE, + rw->type == SDL_RWOPS_STDFILE, "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type); #endif @@ -417,7 +417,7 @@ rwops_testFPRead(void) /* Check type */ SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE, + rw->type == SDL_RWOPS_STDFILE, "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type); /* Run generic tests */ @@ -467,7 +467,7 @@ rwops_testFPWrite(void) /* Check type */ SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE, + rw->type == SDL_RWOPS_STDFILE, "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type); /* Run generic tests */ @@ -498,9 +498,9 @@ rwops_testAllocFree (void) /* Check type */ SDLTest_AssertCheck( - rw->type == SDL_RWOPS_UNKNOWN, + rw->type == SDL_RWOPS_UNKNOWN, "Verify RWops type is SDL_RWOPS_UNKNOWN; expected: %d, got: %d", SDL_RWOPS_UNKNOWN, rw->type); - + /* Free context again */ SDL_FreeRW(rw); SDLTest_AssertPass("Call to SDL_FreeRW() succeeded"); @@ -529,13 +529,13 @@ rwops_testCompareRWFromMemWithRWFromFile(void) int size; int result; - + for (size=5; size<10; size++) { /* Terminate buffer */ buffer_file[slen] = 0; buffer_mem[slen] = 0; - + /* Read/seek from memory */ rwops_mem = SDL_RWFromMem((void *)RWopsAlphabetString, slen); SDLTest_AssertPass("Call to SDL_RWFromMem()"); @@ -557,7 +557,7 @@ rwops_testCompareRWFromMemWithRWFromFile(void) result = SDL_RWclose(rwops_file); SDLTest_AssertPass("Call to SDL_RWclose(file)"); SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); - + /* Compare */ SDLTest_AssertCheck(rv_mem == rv_file, "Verify returned read blocks matches for mem and file reads; got: rv_mem=%d rv_file=%d", rv_mem, rv_file); SDLTest_AssertCheck(sv_mem == sv_file, "Verify SEEK_END position matches for mem and file seeks; got: sv_mem=%llu sv_file=%llu", sv_mem, sv_file); @@ -570,7 +570,7 @@ rwops_testCompareRWFromMemWithRWFromFile(void) SDL_strncmp(buffer_file, RWopsAlphabetString, slen) == 0, "Verify file buffer contain alphabet string; expected: %s, got: %s", RWopsAlphabetString, buffer_file); } - + return TEST_COMPLETED; } @@ -605,7 +605,7 @@ rwops_testFileWriteReadEndian(void) int cresult; for (mode = 0; mode < 3; mode++) { - + /* Create test data */ switch (mode) { case 0: @@ -636,7 +636,7 @@ rwops_testFileWriteReadEndian(void) LE64value = SDLTest_RandomUint64(); break; } - + /* Write test. */ rw = SDL_RWFromFile(RWopsWriteTestFilename, "w+"); SDLTest_AssertPass("Call to SDL_RWFromFile(..,\"w+\")"); @@ -648,22 +648,22 @@ rwops_testFileWriteReadEndian(void) /* Write test data */ objectsWritten = SDL_WriteBE16(rw, BE16value); SDLTest_AssertPass("Call to SDL_WriteBE16"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteBE32(rw, BE32value); SDLTest_AssertPass("Call to SDL_WriteBE32"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteBE64(rw, BE64value); SDLTest_AssertPass("Call to SDL_WriteBE64"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteLE16(rw, LE16value); SDLTest_AssertPass("Call to SDL_WriteLE16"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteLE32(rw, LE32value); SDLTest_AssertPass("Call to SDL_WriteLE32"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); objectsWritten = SDL_WriteLE64(rw, LE64value); SDLTest_AssertPass("Call to SDL_WriteLE64"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten); /* Test seek to start */ result = SDL_RWseek( rw, 0, RW_SEEK_SET ); @@ -676,16 +676,16 @@ rwops_testFileWriteReadEndian(void) SDLTest_AssertCheck(BE16test == BE16value, "Validate return value from SDL_ReadBE16, expected: %hu, got: %hu", BE16value, BE16test); BE32test = SDL_ReadBE32(rw); SDLTest_AssertPass("Call to SDL_ReadBE32"); - SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %u, got: %u", BE32value, BE32test); + SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %u, got: %u", BE32value, BE32test); BE64test = SDL_ReadBE64(rw); SDLTest_AssertPass("Call to SDL_ReadBE64"); - SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %llu, got: %llu", BE64value, BE64test); + SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %llu, got: %llu", BE64value, BE64test); LE16test = SDL_ReadLE16(rw); SDLTest_AssertPass("Call to SDL_ReadLE16"); SDLTest_AssertCheck(LE16test == LE16value, "Validate return value from SDL_ReadLE16, expected: %hu, got: %hu", LE16value, LE16test); LE32test = SDL_ReadLE32(rw); SDLTest_AssertPass("Call to SDL_ReadLE32"); - SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %u, got: %u", LE32value, LE32test); + SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %u, got: %u", LE32value, LE32test); LE64test = SDL_ReadLE64(rw); SDLTest_AssertPass("Call to SDL_ReadLE64"); SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %llu, got: %llu", LE64value, LE64test); @@ -693,7 +693,7 @@ rwops_testFileWriteReadEndian(void) /* Close handle */ cresult = SDL_RWclose(rw); SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); - SDLTest_AssertCheck(cresult == 0, "Verify result value is 0; got: %d", cresult); + SDLTest_AssertCheck(cresult == 0, "Verify result value is 0; got: %d", cresult); } return TEST_COMPLETED; @@ -704,45 +704,45 @@ rwops_testFileWriteReadEndian(void) /* RWops test cases */ static const SDLTest_TestCaseReference rwopsTest1 = - { (SDLTest_TestCaseFp)rwops_testParamNegative, "rwops_testParamNegative", "Negative test for SDL_RWFromFile parameters", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testParamNegative, "rwops_testParamNegative", "Negative test for SDL_RWFromFile parameters", TEST_ENABLED }; static const SDLTest_TestCaseReference rwopsTest2 = - { (SDLTest_TestCaseFp)rwops_testMem, "rwops_testMem", "Tests opening from memory", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testMem, "rwops_testMem", "Tests opening from memory", TEST_ENABLED }; static const SDLTest_TestCaseReference rwopsTest3 = - { (SDLTest_TestCaseFp)rwops_testConstMem, "rwops_testConstMem", "Tests opening from (const) memory", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testConstMem, "rwops_testConstMem", "Tests opening from (const) memory", TEST_ENABLED }; static const SDLTest_TestCaseReference rwopsTest4 = - { (SDLTest_TestCaseFp)rwops_testFileRead, "rwops_testFileRead", "Tests reading from a file", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testFileRead, "rwops_testFileRead", "Tests reading from a file", TEST_ENABLED }; static const SDLTest_TestCaseReference rwopsTest5 = - { (SDLTest_TestCaseFp)rwops_testFileWrite, "rwops_testFileWrite", "Test writing to a file", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testFileWrite, "rwops_testFileWrite", "Test writing to a file", TEST_ENABLED }; static const SDLTest_TestCaseReference rwopsTest6 = - { (SDLTest_TestCaseFp)rwops_testFPRead, "rwops_testFPRead", "Test reading from file pointer", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testFPRead, "rwops_testFPRead", "Test reading from file pointer", TEST_ENABLED }; static const SDLTest_TestCaseReference rwopsTest7 = - { (SDLTest_TestCaseFp)rwops_testFPWrite, "rwops_testFPWrite", "Test writing to file pointer", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testFPWrite, "rwops_testFPWrite", "Test writing to file pointer", TEST_ENABLED }; static const SDLTest_TestCaseReference rwopsTest8 = - { (SDLTest_TestCaseFp)rwops_testAllocFree, "rwops_testAllocFree", "Test alloc and free of RW context", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testAllocFree, "rwops_testAllocFree", "Test alloc and free of RW context", TEST_ENABLED }; static const SDLTest_TestCaseReference rwopsTest9 = - { (SDLTest_TestCaseFp)rwops_testFileWriteReadEndian, "rwops_testFileWriteReadEndian", "Test writing and reading via the Endian aware functions", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testFileWriteReadEndian, "rwops_testFileWriteReadEndian", "Test writing and reading via the Endian aware functions", TEST_ENABLED }; static const SDLTest_TestCaseReference rwopsTest10 = - { (SDLTest_TestCaseFp)rwops_testCompareRWFromMemWithRWFromFile, "rwops_testCompareRWFromMemWithRWFromFile", "Compare RWFromMem and RWFromFile RWops for read and seek", TEST_ENABLED }; + { (SDLTest_TestCaseFp)rwops_testCompareRWFromMemWithRWFromFile, "rwops_testCompareRWFromMemWithRWFromFile", "Compare RWFromMem and RWFromFile RWops for read and seek", TEST_ENABLED }; /* Sequence of RWops test cases */ static const SDLTest_TestCaseReference *rwopsTests[] = { - &rwopsTest1, &rwopsTest2, &rwopsTest3, &rwopsTest4, &rwopsTest5, &rwopsTest6, - &rwopsTest7, &rwopsTest8, &rwopsTest9, &rwopsTest10, NULL + &rwopsTest1, &rwopsTest2, &rwopsTest3, &rwopsTest4, &rwopsTest5, &rwopsTest6, + &rwopsTest7, &rwopsTest8, &rwopsTest9, &rwopsTest10, NULL }; /* RWops test suite (global) */ SDLTest_TestSuiteReference rwopsTestSuite = { - "RWops", - RWopsSetUp, - rwopsTests, - RWopsTearDown + "RWops", + RWopsSetUp, + rwopsTests, + RWopsTearDown }; diff --git a/test/testautomation_sdltest.c b/test/testautomation_sdltest.c index fc9a13c86..e0d921b49 100644 --- a/test/testautomation_sdltest.c +++ b/test/testautomation_sdltest.c @@ -2,6 +2,15 @@ * SDL_test test suite */ +/* 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 @@ -20,18 +29,18 @@ sdltest_getFuzzerInvocationCount(void *arg) { Uint8 result; int fuzzerCount1, fuzzerCount2; - + fuzzerCount1 = SDLTest_GetFuzzerInvocationCount(); SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()"); SDLTest_AssertCheck(fuzzerCount1 >= 0, "Verify returned value, expected: >=0, got: %d", fuzzerCount1); - + result = SDLTest_RandomUint8(); SDLTest_AssertPass("Call to SDLTest_RandomUint8(), returned %d", result); fuzzerCount2 = SDLTest_GetFuzzerInvocationCount(); SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()"); SDLTest_AssertCheck(fuzzerCount2 > fuzzerCount1, "Verify returned value, expected: >%d, got: %d", fuzzerCount1, fuzzerCount2); - + return TEST_COMPLETED; } @@ -47,25 +56,25 @@ sdltest_randomNumber(void *arg) double dresult; Uint64 umax; Sint64 min, max; - + result = (Sint64)SDLTest_RandomUint8(); umax = (1 << 8) - 1; SDLTest_AssertPass("Call to SDLTest_RandomUint8"); SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result); result = (Sint64)SDLTest_RandomSint8(); - min = 1 - (1 << 7); + min = 0 - (1 << 7); max = (1 << 7) - 1; SDLTest_AssertPass("Call to SDLTest_RandomSint8"); SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result); - + result = (Sint64)SDLTest_RandomUint16(); umax = (1 << 16) - 1; SDLTest_AssertPass("Call to SDLTest_RandomUint16"); SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result); result = (Sint64)SDLTest_RandomSint16(); - min = 1 - (1 << 15); + min = 0 - (1 << 15); max = (1 << 15) - 1; SDLTest_AssertPass("Call to SDLTest_RandomSint16"); SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result); @@ -76,7 +85,7 @@ sdltest_randomNumber(void *arg) SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result); result = (Sint64)SDLTest_RandomSint32(); - min = 1 - ((Sint64)1 << 31); + min = 0 - ((Sint64)1 << 31); max = ((Sint64)1 << 31) - 1; SDLTest_AssertPass("Call to SDLTest_RandomSint32"); SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result); @@ -90,7 +99,7 @@ sdltest_randomNumber(void *arg) dresult = (double)SDLTest_RandomUnitFloat(); SDLTest_AssertPass("Call to SDLTest_RandomUnitFloat"); SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0, "Verify result value, expected: [0.0,1.0[, got: %e", dresult); - + dresult = (double)SDLTest_RandomFloat(); SDLTest_AssertPass("Call to SDLTest_RandomFloat"); SDLTest_AssertCheck(dresult >= (double)(-FLT_MAX) && dresult <= (double)FLT_MAX, "Verify result value, expected: [%e,%e], got: %e", (double)(-FLT_MAX), (double)FLT_MAX, dresult); @@ -101,7 +110,7 @@ sdltest_randomNumber(void *arg) dresult = SDLTest_RandomDouble(); SDLTest_AssertPass("Call to SDLTest_RandomDouble"); - + return TEST_COMPLETED; } @@ -124,56 +133,56 @@ sdltest_randomBoundaryNumberUint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); - + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); /* RandomUintXBoundaryValue(1, 0xff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 255, SDL_FALSE); @@ -234,56 +243,56 @@ sdltest_randomBoundaryNumberUint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); - + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); /* RandomUintXBoundaryValue(1, 0xffff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, SDL_FALSE); @@ -324,7 +333,7 @@ sdltest_randomBoundaryNumberUint16(void *arg) return TEST_COMPLETED; } - + /* * @brief Calls to random boundary number generators for Uint32 */ @@ -344,56 +353,56 @@ sdltest_randomBoundaryNumberUint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); - + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); /* RandomUintXBoundaryValue(1, 0xffffffff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, SDL_FALSE); @@ -454,56 +463,56 @@ sdltest_randomBoundaryNumberUint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult); /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult); /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); - + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult); + /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult); /* RandomUintXBoundaryValue(1, 0xffffffffffffffff, SDL_FALSE) returns 0 (no error) */ uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, (Uint64)0xffffffffffffffffULL, SDL_FALSE); @@ -564,56 +573,56 @@ sdltest_randomBoundaryNumberSint8(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); - + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + /* RandomSintXBoundaryValue(SCHAR_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); /* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE); @@ -651,7 +660,7 @@ sdltest_randomBoundaryNumberSint8(void *arg) /* Clear error messages */ SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - + return TEST_COMPLETED; } @@ -674,56 +683,56 @@ sdltest_randomBoundaryNumberSint16(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); - + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + /* RandomSintXBoundaryValue(SHRT_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); /* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE) returns SHRT_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE); @@ -764,7 +773,7 @@ sdltest_randomBoundaryNumberSint16(void *arg) return TEST_COMPLETED; } - + /* * @brief Calls to random boundary number generators for Sint32 */ @@ -774,6 +783,13 @@ sdltest_randomBoundaryNumberSint32(void *arg) const char *expectedError = "That operation is not supported"; char *lastError; Sint64 sresult; +#if ((ULONG_MAX) == (UINT_MAX)) + Sint32 long_min = LONG_MIN; + Sint32 long_max = LONG_MAX; +#else + Sint32 long_min = INT_MIN; + Sint32 long_max = INT_MAX; +#endif /* Clean error messages */ SDL_ClearError(); @@ -784,83 +800,83 @@ sdltest_randomBoundaryNumberSint32(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); - + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + /* RandomSintXBoundaryValue(LONG_MIN, 99, SDL_FALSE) returns 100 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(LONG_MIN, 99, SDL_FALSE); + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); /* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE) returns LONG_MIN (no error) */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE); + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( - sresult == LONG_MIN, - "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", LONG_MIN, sresult); + sresult == long_min, + "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", long_min, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX - 1, SDL_FALSE) returns LONG_MAX (no error) */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(LONG_MIN, LONG_MAX - 1, SDL_FALSE); + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max - 1, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( - sresult == LONG_MAX, - "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %lld", LONG_MAX, sresult); + sresult == long_max, + "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %lld", long_max, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || SDL_strlen(lastError) == 0, "Validate no error message was set"); /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX, SDL_FALSE) returns 0 (sets error) */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(LONG_MIN, LONG_MAX, SDL_FALSE); + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( - sresult == LONG_MIN, - "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", LONG_MIN, sresult); + sresult == long_min, + "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", long_min, sresult); lastError = (char *)SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -894,56 +910,56 @@ sdltest_randomBoundaryNumberSint64(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 11, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 12, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 13, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult); /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 20, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(20, 10, SDL_TRUE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult); /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(1, 20, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); - + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult); + /* RandomSintXBoundaryValue(LLONG_MIN, 99, SDL_FALSE) returns 100 */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN, 99, SDL_FALSE); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); + "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult); /* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE) returns LLONG_MIN (no error) */ sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE); @@ -993,6 +1009,13 @@ sdltest_randomIntegerInRange(void *arg) { Sint32 min, max; Sint32 result; +#if ((ULONG_MAX) == (UINT_MAX)) + Sint32 long_min = LONG_MIN; + Sint32 long_max = LONG_MAX; +#else + Sint32 long_min = INT_MIN; + Sint32 long_max = INT_MAX; +#endif /* Standard range */ min = (Sint32)SDLTest_RandomSint16(); @@ -1029,24 +1052,23 @@ sdltest_randomIntegerInRange(void *arg) SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(max,min)"); SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result); - /* Range with min at integer limit */ - min = LONG_MIN; - max = LONG_MIN + (Sint32)SDLTest_RandomSint16(); + min = long_min; + max = long_max + (Sint32)SDLTest_RandomSint16(); result = SDLTest_RandomIntegerInRange(min, max); SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,...)"); SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result); /* Range with max at integer limit */ - min = LONG_MAX - (Sint32)SDLTest_RandomSint16();; - max = LONG_MAX; + min = long_min - (Sint32)SDLTest_RandomSint16();; + max = long_max; result = SDLTest_RandomIntegerInRange(min, max); SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(...,SINT32_MAX)"); SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result); /* Full integer range */ - min = LONG_MIN; - max = LONG_MAX; + min = long_min; + max = long_max; result = SDLTest_RandomIntegerInRange(min, max); SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,SINT32_MAX)"); SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result); @@ -1079,11 +1101,11 @@ sdltest_randomAsciiString(void *arg) } SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters); if (nonAsciiCharacters) { - SDLTest_LogError("Invalid result from generator: '%s'", result); + SDLTest_LogError("Invalid result from generator: '%s'", result); } - SDL_free(result); + SDL_free(result); } - + return TEST_COMPLETED; } @@ -1117,9 +1139,9 @@ sdltest_randomAsciiStringWithMaximumLength(void *arg) } SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters); if (nonAsciiCharacters) { - SDLTest_LogError("Invalid result from generator: '%s'", result); + SDLTest_LogError("Invalid result from generator: '%s'", result); } - SDL_free(result); + SDL_free(result); } /* Negative test */ @@ -1137,7 +1159,7 @@ sdltest_randomAsciiStringWithMaximumLength(void *arg) /* Clear error messages */ SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - + return TEST_COMPLETED; } @@ -1169,13 +1191,13 @@ sdltest_randomAsciiStringOfSize(void *arg) nonAsciiCharacters++; } } - SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters); + SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-ASCII characters, got: %d", nonAsciiCharacters); if (nonAsciiCharacters) { - SDLTest_LogError("Invalid result from generator: '%s'", result); + SDLTest_LogError("Invalid result from generator: '%s'", result); } - SDL_free(result); + SDL_free(result); } - + /* Negative test */ targetLen = 0; result = SDLTest_RandomAsciiStringOfSize(targetLen); @@ -1191,7 +1213,7 @@ sdltest_randomAsciiStringOfSize(void *arg) /* Clear error messages */ SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - + return TEST_COMPLETED; } @@ -1200,58 +1222,58 @@ sdltest_randomAsciiStringOfSize(void *arg) /* SDL_test test cases */ static const SDLTest_TestCaseReference sdltestTest1 = - { (SDLTest_TestCaseFp)sdltest_getFuzzerInvocationCount, "sdltest_getFuzzerInvocationCount", "Call to sdltest_GetFuzzerInvocationCount", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_getFuzzerInvocationCount, "sdltest_getFuzzerInvocationCount", "Call to sdltest_GetFuzzerInvocationCount", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest2 = - { (SDLTest_TestCaseFp)sdltest_randomNumber, "sdltest_randomNumber", "Calls to random number generators", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomNumber, "sdltest_randomNumber", "Calls to random number generators", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest3 = - { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint8, "sdltest_randomBoundaryNumberUint8", "Calls to random boundary number generators for Uint8", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint8, "sdltest_randomBoundaryNumberUint8", "Calls to random boundary number generators for Uint8", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest4 = - { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint16, "sdltest_randomBoundaryNumberUint16", "Calls to random boundary number generators for Uint16", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint16, "sdltest_randomBoundaryNumberUint16", "Calls to random boundary number generators for Uint16", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest5 = - { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint32, "sdltest_randomBoundaryNumberUint32", "Calls to random boundary number generators for Uint32", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint32, "sdltest_randomBoundaryNumberUint32", "Calls to random boundary number generators for Uint32", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest6 = - { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint64, "sdltest_randomBoundaryNumberUint64", "Calls to random boundary number generators for Uint64", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint64, "sdltest_randomBoundaryNumberUint64", "Calls to random boundary number generators for Uint64", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest7 = - { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint8, "sdltest_randomBoundaryNumberSint8", "Calls to random boundary number generators for Sint8", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint8, "sdltest_randomBoundaryNumberSint8", "Calls to random boundary number generators for Sint8", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest8 = - { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint16, "sdltest_randomBoundaryNumberSint16", "Calls to random boundary number generators for Sint16", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint16, "sdltest_randomBoundaryNumberSint16", "Calls to random boundary number generators for Sint16", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest9 = - { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint32, "sdltest_randomBoundaryNumberSint32", "Calls to random boundary number generators for Sint32", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint32, "sdltest_randomBoundaryNumberSint32", "Calls to random boundary number generators for Sint32", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest10 = - { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint64, "sdltest_randomBoundaryNumberSint64", "Calls to random boundary number generators for Sint64", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint64, "sdltest_randomBoundaryNumberSint64", "Calls to random boundary number generators for Sint64", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest11 = - { (SDLTest_TestCaseFp)sdltest_randomIntegerInRange, "sdltest_randomIntegerInRange", "Calls to ranged random number generator", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomIntegerInRange, "sdltest_randomIntegerInRange", "Calls to ranged random number generator", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest12 = - { (SDLTest_TestCaseFp)sdltest_randomAsciiString, "sdltest_randomAsciiString", "Calls to default ASCII string generator", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomAsciiString, "sdltest_randomAsciiString", "Calls to default ASCII string generator", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest13 = - { (SDLTest_TestCaseFp)sdltest_randomAsciiStringWithMaximumLength, "sdltest_randomAsciiStringWithMaximumLength", "Calls to random maximum length ASCII string generator", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomAsciiStringWithMaximumLength, "sdltest_randomAsciiStringWithMaximumLength", "Calls to random maximum length ASCII string generator", TEST_ENABLED }; static const SDLTest_TestCaseReference sdltestTest14 = - { (SDLTest_TestCaseFp)sdltest_randomAsciiStringOfSize, "sdltest_randomAsciiStringOfSize", "Calls to fixed size ASCII string generator", TEST_ENABLED }; + { (SDLTest_TestCaseFp)sdltest_randomAsciiStringOfSize, "sdltest_randomAsciiStringOfSize", "Calls to fixed size ASCII string generator", TEST_ENABLED }; /* Sequence of SDL_test test cases */ static const SDLTest_TestCaseReference *sdltestTests[] = { - &sdltestTest1, &sdltestTest2, &sdltestTest3, &sdltestTest4, &sdltestTest5, &sdltestTest6, - &sdltestTest7, &sdltestTest8, &sdltestTest9, &sdltestTest10, &sdltestTest11, &sdltestTest12, - &sdltestTest13, &sdltestTest14, NULL + &sdltestTest1, &sdltestTest2, &sdltestTest3, &sdltestTest4, &sdltestTest5, &sdltestTest6, + &sdltestTest7, &sdltestTest8, &sdltestTest9, &sdltestTest10, &sdltestTest11, &sdltestTest12, + &sdltestTest13, &sdltestTest14, NULL }; /* SDL_test test suite (global) */ SDLTest_TestSuiteReference sdltestTestSuite = { - "SDLtest", - NULL, - sdltestTests, - NULL + "SDLtest", + NULL, + sdltestTests, + NULL }; diff --git a/test/testautomation_stdlib.c b/test/testautomation_stdlib.c new file mode 100644 index 000000000..93ce8911d --- /dev/null +++ b/test/testautomation_stdlib.c @@ -0,0 +1,142 @@ +/** + * Standard C library routine test suite + */ + +#include + +#include "SDL.h" +#include "SDL_test.h" + + +/* Test case functions */ + +/** + * @brief Call to SDL_strlcpy + */ +#undef SDL_strlcpy +int +stdlib_strlcpy(void *arg) +{ + size_t result; + char text[1024]; + const char *expected; + + result = SDL_strlcpy(text, "foo", sizeof(text)); + expected = "foo"; + SDLTest_AssertPass("Call to SDL_strlcpy(\"foo\")"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_strlcpy(text, "foo", 2); + expected = "f"; + SDLTest_AssertPass("Call to SDL_strlcpy(\"foo\") with buffer size 2"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == 3, "Check result value, expected: 3, got: %d", result); + + return TEST_COMPLETED; +} + +/** + * @brief Call to SDL_snprintf + */ +#undef SDL_snprintf +int +stdlib_snprintf(void *arg) +{ + int result; + char text[1024]; + const char *expected; + + result = SDL_snprintf(text, sizeof(text), "%s", "foo"); + expected = "foo"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%s\", \"foo\")"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, 2, "%s", "foo"); + expected = "f"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%s\", \"foo\") with buffer size 2"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == 3, "Check result value, expected: 3, got: %d", result); + + result = SDL_snprintf(NULL, 0, "%s", "foo"); + SDLTest_AssertCheck(result == 3, "Check result value, expected: 3, got: %d", result); + + result = SDL_snprintf(text, sizeof(text), "%f", 1.0); + expected = "1.000000"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%f\", 1.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%.f", 1.0); + expected = "1"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%.f\", 1.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%#.f", 1.0); + expected = "1."; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%#.f\", 1.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%f", 1.0 + 1.0 / 3.0); + expected = "1.333333"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%+f", 1.0 + 1.0 / 3.0); + expected = "+1.333333"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%+f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%.2f", 1.0 + 1.0 / 3.0); + expected = "1.33"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%.2f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%6.2f", 1.0 + 1.0 / 3.0); + expected = " 1.33"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%6.2f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, sizeof(text), "%06.2f", 1.0 + 1.0 / 3.0); + expected = "001.33"; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%06.2f\", 1.0 + 1.0 / 3.0)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result); + + result = SDL_snprintf(text, 5, "%06.2f", 1.0 + 1.0 / 3.0); + expected = "001."; + SDLTest_AssertPass("Call to SDL_snprintf(\"%%06.2f\", 1.0 + 1.0 / 3.0) with buffer size 5"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text); + SDLTest_AssertCheck(result == 6, "Check result value, expected: 6, got: %d", result); + + return TEST_COMPLETED; +} + +/* ================= Test References ================== */ + +/* Standard C routine test cases */ +static const SDLTest_TestCaseReference stdlibTest1 = + { (SDLTest_TestCaseFp)stdlib_strlcpy, "stdlib_strlcpy", "Call to SDL_strlcpy", TEST_ENABLED }; + +static const SDLTest_TestCaseReference stdlibTest2 = + { (SDLTest_TestCaseFp)stdlib_snprintf, "stdlib_snprintf", "Call to SDL_snprintf", TEST_ENABLED }; + +/* Sequence of Standard C routine test cases */ +static const SDLTest_TestCaseReference *stdlibTests[] = { + &stdlibTest1, &stdlibTest2, NULL +}; + +/* Timer test suite (global) */ +SDLTest_TestSuiteReference stdlibTestSuite = { + "Standard C routines", + NULL, + stdlibTests, + NULL +}; diff --git a/test/testautomation_suites.h b/test/testautomation_suites.h index 2de9ae28e..695681b13 100644 --- a/test/testautomation_suites.h +++ b/test/testautomation_suites.h @@ -14,35 +14,39 @@ extern SDLTest_TestSuiteReference clipboardTestSuite; extern SDLTest_TestSuiteReference eventsTestSuite; extern SDLTest_TestSuiteReference keyboardTestSuite; extern SDLTest_TestSuiteReference mainTestSuite; +extern SDLTest_TestSuiteReference mouseTestSuite; +extern SDLTest_TestSuiteReference pixelsTestSuite; extern SDLTest_TestSuiteReference platformTestSuite; extern SDLTest_TestSuiteReference rectTestSuite; extern SDLTest_TestSuiteReference renderTestSuite; extern SDLTest_TestSuiteReference rwopsTestSuite; +extern SDLTest_TestSuiteReference sdltestTestSuite; +extern SDLTest_TestSuiteReference stdlibTestSuite; extern SDLTest_TestSuiteReference surfaceTestSuite; extern SDLTest_TestSuiteReference syswmTestSuite; -extern SDLTest_TestSuiteReference sdltestTestSuite; -extern SDLTest_TestSuiteReference videoTestSuite; -extern SDLTest_TestSuiteReference mouseTestSuite; extern SDLTest_TestSuiteReference timerTestSuite; +extern SDLTest_TestSuiteReference videoTestSuite; // All test suites SDLTest_TestSuiteReference *testSuites[] = { - &audioTestSuite, - &clipboardTestSuite, - &eventsTestSuite, - &keyboardTestSuite, - &mainTestSuite, - &platformTestSuite, - &rectTestSuite, - &renderTestSuite, - &rwopsTestSuite, - &surfaceTestSuite, - &syswmTestSuite, - &sdltestTestSuite, - &videoTestSuite, - &mouseTestSuite, - &timerTestSuite, - NULL + &audioTestSuite, + &clipboardTestSuite, + &eventsTestSuite, + &keyboardTestSuite, + &mainTestSuite, + &mouseTestSuite, + &pixelsTestSuite, + &platformTestSuite, + &rectTestSuite, + &renderTestSuite, + &rwopsTestSuite, + &sdltestTestSuite, + &stdlibTestSuite, + &surfaceTestSuite, + &syswmTestSuite, + &timerTestSuite, + &videoTestSuite, + NULL }; #endif diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index a049f6fbe..3f6c56c9a 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -56,21 +56,21 @@ _surfaceSetUp(void *arg) SDLTest_AssertCheck(result == 0, "Validate result from SDL_SetSurfaceBlendMode, expected: 0, got: %i", result); result = SDL_GetSurfaceBlendMode(testSurface, ¤tBlendMode); SDLTest_AssertCheck(result == 0, "Validate result from SDL_GetSurfaceBlendMode, expected: 0, got: %i", result); - SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %i, got: %i", blendMode, currentBlendMode); + SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %i, got: %i", blendMode, currentBlendMode); } } void _surfaceTearDown(void *arg) { - if (referenceSurface != NULL) { - SDL_FreeSurface(referenceSurface); - referenceSurface = NULL; - } - if (testSurface != NULL) { - SDL_FreeSurface(testSurface); - testSurface = NULL; - } + if (referenceSurface != NULL) { + SDL_FreeSurface(referenceSurface); + referenceSurface = NULL; + } + if (testSurface != NULL) { + SDL_FreeSurface(testSurface); + testSurface = NULL; + } } /** @@ -78,15 +78,15 @@ _surfaceTearDown(void *arg) */ void _clearTestSurface() { - int ret; - Uint32 color; + int ret; + Uint32 color; - /* Clear surface. */ - color = SDL_MapRGBA( testSurface->format, 0, 0, 0, 0); - SDLTest_AssertPass("Call to SDL_MapRGBA()"); - ret = SDL_FillRect( testSurface, NULL, color); - SDLTest_AssertPass("Call to SDL_FillRect()"); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillRect, expected: 0, got: %i", ret); + /* Clear surface. */ + color = SDL_MapRGBA( testSurface->format, 0, 0, 0, 0); + SDLTest_AssertPass("Call to SDL_MapRGBA()"); + ret = SDL_FillRect( testSurface, NULL, color); + SDLTest_AssertPass("Call to SDL_FillRect()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillRect, expected: 0, got: %i", ret); } /** @@ -94,119 +94,119 @@ void _clearTestSurface() */ void _testBlitBlendMode(int mode) { - int ret; - int i, j, ni, nj; - SDL_Surface *face; - SDL_Rect rect; - int nmode; - SDL_BlendMode bmode; - int checkFailCount1; - int checkFailCount2; - int checkFailCount3; - int checkFailCount4; + int ret; + int i, j, ni, nj; + SDL_Surface *face; + SDL_Rect rect; + int nmode; + SDL_BlendMode bmode; + int checkFailCount1; + int checkFailCount2; + int checkFailCount3; + int checkFailCount4; - /* Check test surface */ - SDLTest_AssertCheck(testSurface != NULL, "Verify testSurface is not NULL"); - if (testSurface == NULL) return; - - /* Create sample surface */ - face = SDLTest_ImageFace(); - SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); - if (face == NULL) return; + /* Check test surface */ + SDLTest_AssertCheck(testSurface != NULL, "Verify testSurface is not NULL"); + if (testSurface == NULL) return; - /* Reset alpha modulation */ - ret = SDL_SetSurfaceAlphaMod(face, 255); - SDLTest_AssertPass("Call to SDL_SetSurfaceAlphaMod()"); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceAlphaMod(), expected: 0, got: %i", ret); + /* Create sample surface */ + face = SDLTest_ImageFace(); + SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); + if (face == NULL) return; - /* Reset color modulation */ - ret = SDL_SetSurfaceColorMod(face, 255, 255, 255); - SDLTest_AssertPass("Call to SDL_SetSurfaceColorMod()"); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceColorMod(), expected: 0, got: %i", ret); + /* Reset alpha modulation */ + ret = SDL_SetSurfaceAlphaMod(face, 255); + SDLTest_AssertPass("Call to SDL_SetSurfaceAlphaMod()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceAlphaMod(), expected: 0, got: %i", ret); - /* Reset color key */ - ret = SDL_SetColorKey(face, SDL_FALSE, 0); - SDLTest_AssertPass("Call to SDL_SetColorKey()"); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey(), expected: 0, got: %i", ret); + /* Reset color modulation */ + ret = SDL_SetSurfaceColorMod(face, 255, 255, 255); + SDLTest_AssertPass("Call to SDL_SetSurfaceColorMod()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceColorMod(), expected: 0, got: %i", ret); - /* Clear the test surface */ + /* Reset color key */ + ret = SDL_SetColorKey(face, SDL_FALSE, 0); + SDLTest_AssertPass("Call to SDL_SetColorKey()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey(), expected: 0, got: %i", ret); + + /* Clear the test surface */ _clearTestSurface(); - - /* Target rect size */ - rect.w = face->w; - rect.h = face->h; - - /* Steps to take */ - ni = testSurface->w - face->w; - nj = testSurface->h - face->h; - /* Optionally set blend mode. */ - if (mode >= 0) { - ret = SDL_SetSurfaceBlendMode( face, (SDL_BlendMode)mode ); - SDLTest_AssertPass("Call to SDL_SetSurfaceBlendMode()"); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: 0, got: %i", mode, ret); - } - - /* Test blend mode. */ - checkFailCount1 = 0; - checkFailCount2 = 0; - checkFailCount3 = 0; - checkFailCount4 = 0; - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - if (mode == -2) { - /* Set colour mod. */ - ret = SDL_SetSurfaceColorMod( face, (255/nj)*j, (255/ni)*i, (255/nj)*j ); - if (ret != 0) checkFailCount2++; - } - else if (mode == -3) { - /* Set alpha mod. */ - ret = SDL_SetSurfaceAlphaMod( face, (255/ni)*i ); - if (ret != 0) checkFailCount3++; - } - else if (mode == -4) { - /* Crazy blending mode magic. */ - nmode = (i/4*j/4) % 4; - if (nmode==0) { - bmode = SDL_BLENDMODE_NONE; - } else if (nmode==1) { - bmode = SDL_BLENDMODE_BLEND; - } else if (nmode==2) { - bmode = SDL_BLENDMODE_ADD; - } else if (nmode==3) { - bmode = SDL_BLENDMODE_MOD; - } - ret = SDL_SetSurfaceBlendMode( face, bmode ); - if (ret != 0) checkFailCount4++; - } + /* Target rect size */ + rect.w = face->w; + rect.h = face->h; - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_BlitSurface( face, NULL, testSurface, &rect ); - if (ret != 0) checkFailCount1++; - } - } - SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_BlitSurface, expected: 0, got: %i", checkFailCount1); - SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetSurfaceColorMod, expected: 0, got: %i", checkFailCount2); - SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_SetSurfaceAlphaMod, expected: 0, got: %i", checkFailCount3); - SDLTest_AssertCheck(checkFailCount4 == 0, "Validate results from calls to SDL_SetSurfaceBlendMode, expected: 0, got: %i", checkFailCount4); - - /* Clean up */ - if (face != NULL) { - SDL_FreeSurface(face); - face = NULL; - } + /* Steps to take */ + ni = testSurface->w - face->w; + nj = testSurface->h - face->h; + + /* Optionally set blend mode. */ + if (mode >= 0) { + ret = SDL_SetSurfaceBlendMode( face, (SDL_BlendMode)mode ); + SDLTest_AssertPass("Call to SDL_SetSurfaceBlendMode()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: 0, got: %i", mode, ret); + } + + /* Test blend mode. */ + checkFailCount1 = 0; + checkFailCount2 = 0; + checkFailCount3 = 0; + checkFailCount4 = 0; + for (j=0; j <= nj; j+=4) { + for (i=0; i <= ni; i+=4) { + if (mode == -2) { + /* Set color mod. */ + ret = SDL_SetSurfaceColorMod( face, (255/nj)*j, (255/ni)*i, (255/nj)*j ); + if (ret != 0) checkFailCount2++; + } + else if (mode == -3) { + /* Set alpha mod. */ + ret = SDL_SetSurfaceAlphaMod( face, (255/ni)*i ); + if (ret != 0) checkFailCount3++; + } + else if (mode == -4) { + /* Crazy blending mode magic. */ + nmode = (i/4*j/4) % 4; + if (nmode==0) { + bmode = SDL_BLENDMODE_NONE; + } else if (nmode==1) { + bmode = SDL_BLENDMODE_BLEND; + } else if (nmode==2) { + bmode = SDL_BLENDMODE_ADD; + } else if (nmode==3) { + bmode = SDL_BLENDMODE_MOD; + } + ret = SDL_SetSurfaceBlendMode( face, bmode ); + if (ret != 0) checkFailCount4++; + } + + /* Blitting. */ + rect.x = i; + rect.y = j; + ret = SDL_BlitSurface( face, NULL, testSurface, &rect ); + if (ret != 0) checkFailCount1++; + } + } + SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_BlitSurface, expected: 0, got: %i", checkFailCount1); + SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetSurfaceColorMod, expected: 0, got: %i", checkFailCount2); + SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_SetSurfaceAlphaMod, expected: 0, got: %i", checkFailCount3); + SDLTest_AssertCheck(checkFailCount4 == 0, "Validate results from calls to SDL_SetSurfaceBlendMode, expected: 0, got: %i", checkFailCount4); + + /* Clean up */ + if (face != NULL) { + SDL_FreeSurface(face); + face = NULL; + } } /* Helper to check that a file exists */ void _AssertFileExist(const char *filename) { - struct stat st; - int ret = stat(filename, &st); + struct stat st; + int ret = stat(filename, &st); - SDLTest_AssertCheck(ret == 0, "Verify file '%s' exists", filename); + SDLTest_AssertCheck(ret == 0, "Verify file '%s' exists", filename); } @@ -234,16 +234,16 @@ surface_testSaveLoadBitmap(void *arg) /* Save a surface */ ret = SDL_SaveBMP(face, sampleFilename); SDLTest_AssertPass("Call to SDL_SaveBMP()"); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SaveBMP, expected: 0, got: %i", ret); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SaveBMP, expected: 0, got: %i", ret); _AssertFileExist(sampleFilename); - + /* Load a surface */ rface = SDL_LoadBMP(sampleFilename); SDLTest_AssertPass("Call to SDL_LoadBMP()"); SDLTest_AssertCheck(rface != NULL, "Verify result from SDL_LoadBMP is not NULL"); if (rface != NULL) { - SDLTest_AssertCheck(face->w == rface->w, "Verify width of loaded surface, expected: %i, got: %i", face->w, rface->w); - SDLTest_AssertCheck(face->h == rface->h, "Verify height of loaded surface, expected: %i, got: %i", face->h, rface->h); + SDLTest_AssertCheck(face->w == rface->w, "Verify width of loaded surface, expected: %i, got: %i", face->w, rface->w); + SDLTest_AssertCheck(face->h == rface->h, "Verify height of loaded surface, expected: %i, got: %i", face->h, rface->h); } /* Delete test file; ignore errors */ @@ -251,14 +251,14 @@ surface_testSaveLoadBitmap(void *arg) /* Clean up */ if (face != NULL) { - SDL_FreeSurface(face); - face = NULL; + SDL_FreeSurface(face); + face = NULL; } if (rface != NULL) { - SDL_FreeSurface(rface); - rface = NULL; + SDL_FreeSurface(rface); + rface = NULL; } - + return TEST_COMPLETED; } @@ -268,42 +268,134 @@ surface_testSaveLoadBitmap(void *arg) int surface_testSurfaceConversion(void *arg) { - SDL_Surface *rface = NULL, *face = NULL; - int ret = 0; + SDL_Surface *rface = NULL, *face = NULL; + int ret = 0; - /* Create sample surface */ - face = SDLTest_ImageFace(); - SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); - if (face == NULL) - return TEST_ABORTED; + /* Create sample surface */ + face = SDLTest_ImageFace(); + SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); + if (face == NULL) + return TEST_ABORTED; - /* Set transparent pixel as the pixel at (0,0) */ - if (face->format->palette) { - ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels); - SDLTest_AssertPass("Call to SDL_SetColorKey()"); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey, expected: 0, got: %i", ret); - } + /* Set transparent pixel as the pixel at (0,0) */ + if (face->format->palette) { + ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels); + SDLTest_AssertPass("Call to SDL_SetColorKey()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey, expected: 0, got: %i", ret); + } - /* Convert to 32 bit to compare. */ - rface = SDL_ConvertSurface( face, testSurface->format, 0 ); - SDLTest_AssertPass("Call to SDL_ConvertSurface()"); - SDLTest_AssertCheck(rface != NULL, "Verify result from SDL_ConvertSurface is not NULL"); + /* Convert to 32 bit to compare. */ + rface = SDL_ConvertSurface( face, testSurface->format, 0 ); + SDLTest_AssertPass("Call to SDL_ConvertSurface()"); + SDLTest_AssertCheck(rface != NULL, "Verify result from SDL_ConvertSurface is not NULL"); - /* Compare surface. */ - ret = SDLTest_CompareSurfaces( rface, face, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - if (face != NULL) { - SDL_FreeSurface( face ); - face = NULL; - } - if (rface != NULL) { - SDL_FreeSurface( rface ); - rface = NULL; - } + /* Compare surface. */ + ret = SDLTest_CompareSurfaces( rface, face, 0 ); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - return TEST_COMPLETED; + /* Clean up. */ + if (face != NULL) { + SDL_FreeSurface( face ); + face = NULL; + } + if (rface != NULL) { + SDL_FreeSurface( rface ); + rface = NULL; + } + + return TEST_COMPLETED; +} + + +/*! + * Tests surface conversion across all pixel formats. + */ +int +surface_testCompleteSurfaceConversion(void *arg) +{ + Uint32 pixel_formats[] = { + SDL_PIXELFORMAT_INDEX8, + SDL_PIXELFORMAT_RGB332, + SDL_PIXELFORMAT_RGB444, + SDL_PIXELFORMAT_RGB555, + SDL_PIXELFORMAT_BGR555, + SDL_PIXELFORMAT_ARGB4444, + SDL_PIXELFORMAT_RGBA4444, + SDL_PIXELFORMAT_ABGR4444, + SDL_PIXELFORMAT_BGRA4444, + SDL_PIXELFORMAT_ARGB1555, + SDL_PIXELFORMAT_RGBA5551, + SDL_PIXELFORMAT_ABGR1555, + SDL_PIXELFORMAT_BGRA5551, + SDL_PIXELFORMAT_RGB565, + SDL_PIXELFORMAT_BGR565, + SDL_PIXELFORMAT_RGB24, + SDL_PIXELFORMAT_BGR24, + SDL_PIXELFORMAT_RGB888, + SDL_PIXELFORMAT_RGBX8888, + SDL_PIXELFORMAT_BGR888, + SDL_PIXELFORMAT_BGRX8888, + SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_ARGB2101010, + }; + SDL_Surface *face = NULL, *cvt1, *cvt2, *final; + SDL_PixelFormat *fmt1, *fmt2; + int i, j, ret = 0; + + /* Create sample surface */ + face = SDLTest_ImageFace(); + SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); + if (face == NULL) + return TEST_ABORTED; + + /* Set transparent pixel as the pixel at (0,0) */ + if (face->format->palette) { + ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels); + SDLTest_AssertPass("Call to SDL_SetColorKey()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey, expected: 0, got: %i", ret); + } + + for ( i = 0; i < SDL_arraysize(pixel_formats); ++i ) { + for ( j = 0; j < SDL_arraysize(pixel_formats); ++j ) { + /*printf("Converting %s -> %s\n", SDL_GetPixelFormatName(pixel_formats[i]), SDL_GetPixelFormatName(pixel_formats[j]));*/ + + fmt1 = SDL_AllocFormat(pixel_formats[i]); + SDL_assert(fmt1 != NULL); + cvt1 = SDL_ConvertSurface(face, fmt1, 0); + SDL_assert(cvt1 != NULL); + + fmt2 = SDL_AllocFormat(pixel_formats[j]); + SDL_assert(fmt1 != NULL); + cvt2 = SDL_ConvertSurface(cvt1, fmt2, 0); + SDL_assert(cvt2 != NULL); + + if ( fmt1->BytesPerPixel == face->format->BytesPerPixel && + fmt2->BytesPerPixel == face->format->BytesPerPixel && + (fmt1->Amask != 0) == (face->format->Amask != 0) && + (fmt2->Amask != 0) == (face->format->Amask != 0) ) { + final = SDL_ConvertSurface( cvt2, face->format, 0 ); + SDL_assert(final != NULL); + + /* Compare surface. */ + ret = SDLTest_CompareSurfaces( face, final, 0 ); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + SDL_FreeSurface(final); + } + + SDL_FreeSurface(cvt1); + SDL_FreeFormat(fmt1); + SDL_FreeSurface(cvt2); + SDL_FreeFormat(fmt2); + } + } + + /* Clean up. */ + SDL_FreeSurface( face ); + + return TEST_COMPLETED; } @@ -313,10 +405,10 @@ surface_testSurfaceConversion(void *arg) int surface_testLoadFailure(void *arg) { - SDL_Surface *face = SDL_LoadBMP("nonexistant.bmp"); - SDLTest_AssertCheck(face == NULL, "SDL_CreateLoadBmp"); + SDL_Surface *face = SDL_LoadBMP("nonexistant.bmp"); + SDLTest_AssertCheck(face == NULL, "SDL_CreateLoadBmp"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -328,17 +420,17 @@ surface_testBlit(void *arg) int ret; SDL_Surface *compareSurface; - /* Basic blitting */ + /* Basic blitting */ _testBlitBlendMode(-1); - + /* Verify result by comparing surfaces */ compareSurface = SDLTest_ImageBlit(); ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - + /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); + if (compareSurface != NULL) { + SDL_FreeSurface( compareSurface ); } return TEST_COMPLETED; @@ -353,17 +445,17 @@ surface_testBlitColorMod(void *arg) int ret; SDL_Surface *compareSurface; - /* Basic blitting with color mod */ + /* Basic blitting with color mod */ _testBlitBlendMode(-2); - + /* Verify result by comparing surfaces */ compareSurface = SDLTest_ImageBlitColor(); ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - + /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); + if (compareSurface != NULL) { + SDL_FreeSurface( compareSurface ); } return TEST_COMPLETED; @@ -378,17 +470,17 @@ surface_testBlitAlphaMod(void *arg) int ret; SDL_Surface *compareSurface; - /* Basic blitting with alpha mod */ + /* Basic blitting with alpha mod */ _testBlitBlendMode(-3); - + /* Verify result by comparing surfaces */ compareSurface = SDLTest_ImageBlitAlpha(); ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - + /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); + if (compareSurface != NULL) { + SDL_FreeSurface( compareSurface ); } return TEST_COMPLETED; @@ -404,17 +496,17 @@ surface_testBlitBlendNone(void *arg) int ret; SDL_Surface *compareSurface; - /* Basic blitting */ + /* Basic blitting */ _testBlitBlendMode(SDL_BLENDMODE_NONE); - + /* Verify result by comparing surfaces */ compareSurface = SDLTest_ImageBlitBlendNone(); ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - + /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); + if (compareSurface != NULL) { + SDL_FreeSurface( compareSurface ); } return TEST_COMPLETED; @@ -429,17 +521,17 @@ surface_testBlitBlendBlend(void *arg) int ret; SDL_Surface *compareSurface; - /* Blend blitting */ + /* Blend blitting */ _testBlitBlendMode(SDL_BLENDMODE_BLEND); - + /* Verify result by comparing surfaces */ compareSurface = SDLTest_ImageBlitBlend(); ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - + /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); + if (compareSurface != NULL) { + SDL_FreeSurface( compareSurface ); } return TEST_COMPLETED; @@ -454,17 +546,17 @@ surface_testBlitBlendAdd(void *arg) int ret; SDL_Surface *compareSurface; - /* Add blitting */ + /* Add blitting */ _testBlitBlendMode(SDL_BLENDMODE_ADD); - + /* Verify result by comparing surfaces */ compareSurface = SDLTest_ImageBlitBlendAdd(); ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - + /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); + if (compareSurface != NULL) { + SDL_FreeSurface( compareSurface ); } return TEST_COMPLETED; @@ -479,17 +571,17 @@ surface_testBlitBlendMod(void *arg) int ret; SDL_Surface *compareSurface; - /* Mod blitting */ + /* Mod blitting */ _testBlitBlendMode(SDL_BLENDMODE_MOD); - + /* Verify result by comparing surfaces */ compareSurface = SDLTest_ImageBlitBlendMod(); ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - + /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface( compareSurface ); + if (compareSurface != NULL) { + SDL_FreeSurface( compareSurface ); } return TEST_COMPLETED; @@ -504,17 +596,17 @@ surface_testBlitBlendLoop(void *arg) { int ret; SDL_Surface *compareSurface; - /* All blitting modes */ + /* All blitting modes */ _testBlitBlendMode(-4); - + /* Verify result by comparing surfaces */ compareSurface = SDLTest_ImageBlitBlendAll(); ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - + /* Clean up. */ - if (compareSurface != NULL) { - SDL_FreeSurface(compareSurface); + if (compareSurface != NULL) { + SDL_FreeSurface(compareSurface); } return TEST_COMPLETED; @@ -525,49 +617,56 @@ surface_testBlitBlendLoop(void *arg) { /* Surface test cases */ static const SDLTest_TestCaseReference surfaceTest1 = - { (SDLTest_TestCaseFp)surface_testSaveLoadBitmap, "surface_testSaveLoadBitmap", "Tests sprite saving and loading.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testSaveLoadBitmap, "surface_testSaveLoadBitmap", "Tests sprite saving and loading.", TEST_ENABLED}; static const SDLTest_TestCaseReference surfaceTest2 = - { (SDLTest_TestCaseFp)surface_testBlit, "surface_testBlit", "Tests basic blitting.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testBlit, "surface_testBlit", "Tests basic blitting.", TEST_ENABLED}; static const SDLTest_TestCaseReference surfaceTest3 = - { (SDLTest_TestCaseFp)surface_testBlitBlendNone, "surface_testBlitBlendNone", "Tests blitting routines with none blending mode.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testBlitBlendNone, "surface_testBlitBlendNone", "Tests blitting routines with none blending mode.", TEST_ENABLED}; static const SDLTest_TestCaseReference surfaceTest4 = - { (SDLTest_TestCaseFp)surface_testLoadFailure, "surface_testLoadFailure", "Tests sprite loading. A failure case.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testLoadFailure, "surface_testLoadFailure", "Tests sprite loading. A failure case.", TEST_ENABLED}; static const SDLTest_TestCaseReference surfaceTest5 = - { (SDLTest_TestCaseFp)surface_testSurfaceConversion, "surface_testSurfaceConversion", "Tests surface conversion.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testSurfaceConversion, "surface_testSurfaceConversion", "Tests surface conversion.", TEST_ENABLED}; static const SDLTest_TestCaseReference surfaceTest6 = - { (SDLTest_TestCaseFp)surface_testBlitColorMod, "surface_testBlitColorMod", "Tests some blitting routines with color mod.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testCompleteSurfaceConversion, "surface_testCompleteSurfaceConversion", "Tests surface conversion across all pixel formats", TEST_ENABLED}; static const SDLTest_TestCaseReference surfaceTest7 = - { (SDLTest_TestCaseFp)surface_testBlitAlphaMod, "surface_testBlitAlphaMod", "Tests some blitting routines with alpha mod.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testBlitColorMod, "surface_testBlitColorMod", "Tests some blitting routines with color mod.", TEST_ENABLED}; static const SDLTest_TestCaseReference surfaceTest8 = - { (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blittin routines with verious blending modes", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testBlitAlphaMod, "surface_testBlitAlphaMod", "Tests some blitting routines with alpha mod.", TEST_ENABLED}; +/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest9 = - { (SDLTest_TestCaseFp)surface_testBlitBlendBlend, "surface_testBlitBlendBlend", "Tests blitting routines with blend blending mode.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blittin routines with verious blending modes", TEST_DISABLED}; +/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest10 = - { (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testBlitBlendBlend, "surface_testBlitBlendBlend", "Tests blitting routines with blend blending mode.", TEST_DISABLED}; +/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest11 = - { (SDLTest_TestCaseFp)surface_testBlitBlendMod, "surface_testBlitBlendMod", "Tests blitting routines with mod blending mode.", TEST_ENABLED}; + { (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_DISABLED}; + +static const SDLTest_TestCaseReference surfaceTest12 = + { (SDLTest_TestCaseFp)surface_testBlitBlendMod, "surface_testBlitBlendMod", "Tests blitting routines with mod blending mode.", TEST_ENABLED}; /* Sequence of Surface test cases */ static const SDLTest_TestCaseReference *surfaceTests[] = { - &surfaceTest1, &surfaceTest2, &surfaceTest3, &surfaceTest4, &surfaceTest5, - &surfaceTest6, &surfaceTest7, &surfaceTest8, &surfaceTest9, &surfaceTest10, &surfaceTest11, NULL + &surfaceTest1, &surfaceTest2, &surfaceTest3, &surfaceTest4, &surfaceTest5, + &surfaceTest6, &surfaceTest7, &surfaceTest8, &surfaceTest9, &surfaceTest10, + &surfaceTest11, &surfaceTest12, NULL }; /* Surface test suite (global) */ SDLTest_TestSuiteReference surfaceTestSuite = { - "Surface", - _surfaceSetUp, - surfaceTests, - _surfaceTearDown + "Surface", + _surfaceSetUp, + surfaceTests, + _surfaceTearDown }; diff --git a/test/testautomation_syswm.c b/test/testautomation_syswm.c index b3ee6f4dd..3e368f63e 100644 --- a/test/testautomation_syswm.c +++ b/test/testautomation_syswm.c @@ -17,27 +17,27 @@ int syswm_getWindowWMInfo(void *arg) { SDL_bool result; - SDL_Window *window; + SDL_Window *window; SDL_SysWMinfo info; - + window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN); SDLTest_AssertPass("Call to SDL_CreateWindow()"); SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL"); if (window == NULL) { return TEST_ABORTED; } - + /* Initialize info structure with SDL version info */ - SDL_VERSION(&info.version); - + SDL_VERSION(&info.version); + /* Make call */ result = SDL_GetWindowWMInfo(window, &info); SDLTest_AssertPass("Call to SDL_GetWindowWMInfo"); SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information"); - + SDL_DestroyWindow(window); SDLTest_AssertPass("Call to SDL_DestroyWindow()"); - + return TEST_COMPLETED; } @@ -45,17 +45,17 @@ syswm_getWindowWMInfo(void *arg) /* SysWM test cases */ static const SDLTest_TestCaseReference syswmTest1 = - { (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED }; + { (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED }; /* Sequence of SysWM test cases */ static const SDLTest_TestCaseReference *syswmTests[] = { - &syswmTest1, NULL + &syswmTest1, NULL }; /* SysWM test suite (global) */ SDLTest_TestSuiteReference syswmTestSuite = { - "SysWM", - NULL, - syswmTests, - NULL + "SysWM", + NULL, + syswmTests, + NULL }; diff --git a/test/testautomation_timer.c b/test/testautomation_timer.c index 17f2f65e1..ddf6a5f29 100644 --- a/test/testautomation_timer.c +++ b/test/testautomation_timer.c @@ -21,11 +21,11 @@ int _timerCallbackCalled = 0; void _timerSetUp(void *arg) { - /* Start SDL timer subsystem */ - int ret = SDL_InitSubSystem( SDL_INIT_TIMER ); + /* Start SDL timer subsystem */ + int ret = SDL_InitSubSystem( SDL_INIT_TIMER ); SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_TIMER)"); - SDLTest_AssertCheck(ret==0, "Check result from SDL_InitSubSystem(SDL_INIT_TIMER)"); - if (ret != 0) { + SDLTest_AssertCheck(ret==0, "Check result from SDL_InitSubSystem(SDL_INIT_TIMER)"); + if (ret != 0) { SDLTest_LogError("%s", SDL_GetError()); } } @@ -39,11 +39,11 @@ int timer_getPerformanceCounter(void *arg) { Uint64 result; - + result = SDL_GetPerformanceCounter(); SDLTest_AssertPass("Call to SDL_GetPerformanceCounter()"); SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %lu", result); - + return TEST_COMPLETED; } @@ -54,11 +54,11 @@ int timer_getPerformanceFrequency(void *arg) { Uint64 result; - + result = SDL_GetPerformanceFrequency(); SDLTest_AssertPass("Call to SDL_GetPerformanceFrequency()"); SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %lu", result); - + return TEST_COMPLETED; } @@ -74,23 +74,23 @@ timer_delayAndGetTicks(void *arg) Uint32 result2; Uint32 difference; - /* Zero delay */ + /* Zero delay */ SDL_Delay(0); SDLTest_AssertPass("Call to SDL_Delay(0)"); - + /* Non-zero delay */ SDL_Delay(1); SDLTest_AssertPass("Call to SDL_Delay(1)"); SDL_Delay(SDLTest_RandomIntegerInRange(5, 15)); SDLTest_AssertPass("Call to SDL_Delay()"); - - /* Get ticks count - should be non-zero by now */ + + /* Get ticks count - should be non-zero by now */ result = SDL_GetTicks(); SDLTest_AssertPass("Call to SDL_GetTicks()"); SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %d", result); - /* Delay a bit longer and mesure ticks and verify difference */ + /* Delay a bit longer and measure ticks and verify difference */ SDL_Delay(testDelay); SDLTest_AssertPass("Call to SDL_Delay(%d)", testDelay); result2 = SDL_GetTicks(); @@ -99,7 +99,7 @@ timer_delayAndGetTicks(void *arg) difference = result2 - result; SDLTest_AssertCheck(difference > (testDelay - marginOfError), "Check difference, expected: >%d, got: %d", testDelay - marginOfError, difference); SDLTest_AssertCheck(difference < (testDelay + marginOfError), "Check difference, expected: <%d, got: %d", testDelay + marginOfError, difference); - + return TEST_COMPLETED; } @@ -107,16 +107,15 @@ timer_delayAndGetTicks(void *arg) Uint32 _timerTestCallback(Uint32 interval, void *param) { _timerCallbackCalled = 1; - + if (_paramCheck != 0) { SDLTest_AssertCheck(param != NULL, "Check param pointer, expected: non-NULL, got: %s", (param != NULL) ? "non-NULL" : "NULL"); if (param != NULL) { SDLTest_AssertCheck(*(int *)param == _paramValue, "Check param value, expected: %i, got: %i", _paramValue, *(int *)param); } } - + return 0; - return interval; } /** @@ -132,19 +131,19 @@ timer_addRemoveTimer(void *arg) /* Reset state */ _paramCheck = 0; _timerCallbackCalled = 0; - - /* Set timer with a long delay */ + + /* Set timer with a long delay */ id = SDL_AddTimer(10000, _timerTestCallback, NULL); SDLTest_AssertPass("Call to SDL_AddTimer(10000,...)"); SDLTest_AssertCheck(id > 0, "Check result value, expected: >0, got: %d", id); - + /* Remove timer again and check that callback was not called */ result = SDL_RemoveTimer(id); SDLTest_AssertPass("Call to SDL_RemoveTimer()"); SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected: %i, got: %i", SDL_TRUE, result); SDLTest_AssertCheck(_timerCallbackCalled == 0, "Check callback WAS NOT called, expected: 0, got: %i", _timerCallbackCalled); - /* Try to temove timer again (should be a NOOP) */ + /* Try to remove timer again (should be a NOOP) */ result = SDL_RemoveTimer(id); SDLTest_AssertPass("Call to SDL_RemoveTimer()"); SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected: %i, got: %i", SDL_FALSE, result); @@ -155,21 +154,21 @@ timer_addRemoveTimer(void *arg) _paramValue = param; _timerCallbackCalled = 0; - /* Set timer with a short delay */ + /* Set timer with a short delay */ id = SDL_AddTimer(10, _timerTestCallback, (void *)¶m); SDLTest_AssertPass("Call to SDL_AddTimer(10, param)"); SDLTest_AssertCheck(id > 0, "Check result value, expected: >0, got: %d", id); - + /* Wait to let timer trigger callback */ SDL_Delay(100); SDLTest_AssertPass("Call to SDL_Delay(100)"); - + /* Remove timer again and check that callback was called */ result = SDL_RemoveTimer(id); SDLTest_AssertPass("Call to SDL_RemoveTimer()"); SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected: %i, got: %i", SDL_FALSE, result); SDLTest_AssertCheck(_timerCallbackCalled == 1, "Check callback WAS called, expected: 1, got: %i", _timerCallbackCalled); - + return TEST_COMPLETED; } @@ -177,26 +176,26 @@ timer_addRemoveTimer(void *arg) /* Timer test cases */ static const SDLTest_TestCaseReference timerTest1 = - { (SDLTest_TestCaseFp)timer_getPerformanceCounter, "timer_getPerformanceCounter", "Call to SDL_GetPerformanceCounter", TEST_ENABLED }; + { (SDLTest_TestCaseFp)timer_getPerformanceCounter, "timer_getPerformanceCounter", "Call to SDL_GetPerformanceCounter", TEST_ENABLED }; static const SDLTest_TestCaseReference timerTest2 = - { (SDLTest_TestCaseFp)timer_getPerformanceFrequency, "timer_getPerformanceFrequency", "Call to SDL_GetPerformanceFrequency", TEST_ENABLED }; + { (SDLTest_TestCaseFp)timer_getPerformanceFrequency, "timer_getPerformanceFrequency", "Call to SDL_GetPerformanceFrequency", TEST_ENABLED }; static const SDLTest_TestCaseReference timerTest3 = - { (SDLTest_TestCaseFp)timer_delayAndGetTicks, "timer_delayAndGetTicks", "Call to SDL_Delay and SDL_GetTicks", TEST_ENABLED }; + { (SDLTest_TestCaseFp)timer_delayAndGetTicks, "timer_delayAndGetTicks", "Call to SDL_Delay and SDL_GetTicks", TEST_ENABLED }; static const SDLTest_TestCaseReference timerTest4 = - { (SDLTest_TestCaseFp)timer_addRemoveTimer, "timer_addRemoveTimer", "Call to SDL_AddTimer and SDL_RemoveTimer", TEST_ENABLED }; + { (SDLTest_TestCaseFp)timer_addRemoveTimer, "timer_addRemoveTimer", "Call to SDL_AddTimer and SDL_RemoveTimer", TEST_ENABLED }; /* Sequence of Timer test cases */ static const SDLTest_TestCaseReference *timerTests[] = { - &timerTest1, &timerTest2, &timerTest3, &timerTest4, NULL + &timerTest1, &timerTest2, &timerTest3, &timerTest4, NULL }; /* Timer test suite (global) */ SDLTest_TestSuiteReference timerTestSuite = { - "Timer", - _timerSetUp, - timerTests, - NULL + "Timer", + _timerSetUp, + timerTests, + NULL }; diff --git a/test/testautomation_video.c b/test/testautomation_video.c index 4e2cfa593..46061090e 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -20,7 +20,7 @@ /* Private helpers */ -/* +/* * Create a test window */ SDL_Window *_createVideoSuiteTestWindow(const char *title) @@ -35,7 +35,7 @@ SDL_Window *_createVideoSuiteTestWindow(const char *title) w = SDLTest_RandomIntegerInRange(320, 1024); h = SDLTest_RandomIntegerInRange(320, 768); flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS; - + window = SDL_CreateWindow(title, x, y, w, h, flags); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags); SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); @@ -44,11 +44,11 @@ SDL_Window *_createVideoSuiteTestWindow(const char *title) } /* - * Destroy test window + * Destroy test window */ void _destroyVideoSuiteTestWindow(SDL_Window *window) { - if (window != NULL) { + if (window != NULL) { SDL_DestroyWindow(window); window = NULL; SDLTest_AssertPass("Call to SDL_DestroyWindow"); @@ -63,50 +63,50 @@ void _destroyVideoSuiteTestWindow(SDL_Window *window) int video_enableDisableScreensaver(void *arg) { - SDL_bool initialResult; - SDL_bool result; + SDL_bool initialResult; + SDL_bool result; - /* Get current state and proceed according to current state */ - initialResult = SDL_IsScreenSaverEnabled(); - SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); - if (initialResult == SDL_TRUE) { - - /* Currently enabled: disable first, then enable again */ - - /* Disable screensaver and check */ - SDL_DisableScreenSaver(); - SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); - result = SDL_IsScreenSaverEnabled(); - SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); - - /* Enable screensaver and check */ - SDL_EnableScreenSaver(); - SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); - result = SDL_IsScreenSaverEnabled(); - SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); + /* Get current state and proceed according to current state */ + initialResult = SDL_IsScreenSaverEnabled(); + SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); + if (initialResult == SDL_TRUE) { - } else { + /* Currently enabled: disable first, then enable again */ - /* Currently disabled: enable first, then disable again */ - - /* Enable screensaver and check */ - SDL_EnableScreenSaver(); - SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); - result = SDL_IsScreenSaverEnabled(); - SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); + /* Disable screensaver and check */ + SDL_DisableScreenSaver(); + SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); + result = SDL_IsScreenSaverEnabled(); + SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); + SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); - /* Disable screensaver and check */ - SDL_DisableScreenSaver(); - SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); - result = SDL_IsScreenSaverEnabled(); - SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); - } - - return TEST_COMPLETED; + /* Enable screensaver and check */ + SDL_EnableScreenSaver(); + SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); + result = SDL_IsScreenSaverEnabled(); + SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); + SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); + + } else { + + /* Currently disabled: enable first, then disable again */ + + /* Enable screensaver and check */ + SDL_EnableScreenSaver(); + SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); + result = SDL_IsScreenSaverEnabled(); + SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); + SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); + + /* Disable screensaver and check */ + SDL_DisableScreenSaver(); + SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); + result = SDL_IsScreenSaverEnabled(); + SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); + SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); + } + + return TEST_COMPLETED; } /** @@ -119,73 +119,73 @@ video_createWindowVariousPositions(void *arg) const char* title = "video_createWindowVariousPositions Test Window"; int x, y, w, h; int xVariation, yVariation; - + for (xVariation = 0; xVariation < 6; xVariation++) { for (yVariation = 0; yVariation < 6; yVariation++) { switch(xVariation) { case 0: - /* Zero X Position */ + /* Zero X Position */ x = 0; break; case 1: - /* Random X position inside screen */ + /* Random X position inside screen */ x = SDLTest_RandomIntegerInRange(1, 100); break; case 2: - /* Random X position outside screen (positive) */ + /* Random X position outside screen (positive) */ x = SDLTest_RandomIntegerInRange(10000, 11000); break; case 3: - /* Random X position outside screen (negative) */ + /* Random X position outside screen (negative) */ x = SDLTest_RandomIntegerInRange(-1000, -100); break; case 4: - /* Centered X position */ + /* Centered X position */ x = SDL_WINDOWPOS_CENTERED; break; case 5: - /* Undefined X position */ + /* Undefined X position */ x = SDL_WINDOWPOS_UNDEFINED; break; } switch(yVariation) { case 0: - /* Zero X Position */ + /* Zero X Position */ y = 0; break; case 1: - /* Random X position inside screen */ + /* Random X position inside screen */ y = SDLTest_RandomIntegerInRange(1, 100); break; case 2: - /* Random X position outside screen (positive) */ + /* Random X position outside screen (positive) */ y = SDLTest_RandomIntegerInRange(10000, 11000); break; case 3: - /* Random Y position outside screen (negative) */ + /* Random Y position outside screen (negative) */ y = SDLTest_RandomIntegerInRange(-1000, -100); break; case 4: - /* Centered Y position */ + /* Centered Y position */ y = SDL_WINDOWPOS_CENTERED; break; case 5: - /* Undefined Y position */ + /* Undefined Y position */ y = SDL_WINDOWPOS_UNDEFINED; break; } - + w = SDLTest_RandomIntegerInRange(32, 96); h = SDLTest_RandomIntegerInRange(32, 96); window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); - /* Clean up */ + /* Clean up */ _destroyVideoSuiteTestWindow(window); } - } + } return TEST_COMPLETED; } @@ -200,49 +200,49 @@ video_createWindowVariousSizes(void *arg) const char* title = "video_createWindowVariousSizes Test Window"; int x, y, w, h; int wVariation, hVariation; - + x = SDLTest_RandomIntegerInRange(1, 100); y = SDLTest_RandomIntegerInRange(1, 100); for (wVariation = 0; wVariation < 3; wVariation++) { for (hVariation = 0; hVariation < 3; hVariation++) { switch(wVariation) { case 0: - /* Width of 1 */ + /* Width of 1 */ w = 1; break; case 1: - /* Random "normal" width */ + /* Random "normal" width */ w = SDLTest_RandomIntegerInRange(320, 1920); break; case 2: - /* Random "large" width */ + /* Random "large" width */ w = SDLTest_RandomIntegerInRange(2048, 4095); break; } switch(hVariation) { case 0: - /* Height of 1 */ + /* Height of 1 */ h = 1; break; case 1: - /* Random "normal" height */ + /* Random "normal" height */ h = SDLTest_RandomIntegerInRange(320, 1080); break; case 2: - /* Random "large" height */ + /* Random "large" height */ h = SDLTest_RandomIntegerInRange(2048, 4095); break; } - + window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); - /* Clean up */ + /* Clean up */ _destroyVideoSuiteTestWindow(window); } - } + } return TEST_COMPLETED; } @@ -258,7 +258,7 @@ video_createWindowVariousFlags(void *arg) int x, y, w, h; int fVariation; SDL_WindowFlags flags; - + /* Standard window */ x = SDLTest_RandomIntegerInRange(1, 100); y = SDLTest_RandomIntegerInRange(1, 100); @@ -270,54 +270,54 @@ video_createWindowVariousFlags(void *arg) case 0: flags = SDL_WINDOW_FULLSCREEN; /* Skip - blanks screen; comment out next line to run test */ - continue; + continue; break; case 1: flags = SDL_WINDOW_FULLSCREEN_DESKTOP; /* Skip - blanks screen; comment out next line to run test */ - continue; + continue; break; case 2: flags = SDL_WINDOW_OPENGL; - break; + break; case 3: flags = SDL_WINDOW_SHOWN; - break; - case 4: + break; + case 4: flags = SDL_WINDOW_HIDDEN; - break; + break; case 5: flags = SDL_WINDOW_BORDERLESS; - break; + break; case 6: flags = SDL_WINDOW_RESIZABLE; - break; + break; case 7: flags = SDL_WINDOW_MINIMIZED; - break; + break; case 8: flags = SDL_WINDOW_MAXIMIZED; break; - case 9: + case 9: flags = SDL_WINDOW_INPUT_GRABBED; break; - case 10: + case 10: flags = SDL_WINDOW_INPUT_FOCUS; - break; - case 11: + break; + case 11: flags = SDL_WINDOW_MOUSE_FOCUS; break; - case 12: + case 12: flags = SDL_WINDOW_FOREIGN; break; } - + window = SDL_CreateWindow(title, x, y, w, h, flags); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags); SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); } return TEST_COMPLETED; @@ -334,11 +334,11 @@ video_getWindowFlags(void *arg) const char* title = "video_getWindowFlags Test Window"; SDL_WindowFlags flags; Uint32 actualFlags; - + /* Reliable flag set always set in test window */ flags = SDL_WINDOW_SHOWN; - - /* Call against new test window */ + + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window != NULL) { actualFlags = SDL_GetWindowFlags(window); @@ -346,9 +346,9 @@ video_getWindowFlags(void *arg) SDLTest_AssertCheck((flags & actualFlags) == flags, "Verify returned value has flags %d set, got: %d", flags, actualFlags); } - /* Clean up */ + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + return TEST_COMPLETED; } @@ -366,7 +366,7 @@ video_getNumDisplayModes(void *arg) displayNum = SDL_GetNumVideoDisplays(); SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays"); - /* Make call for each display */ + /* Make call for each display */ for (i=0; i= 0.0 && result <= 1.0, "Validate range of result value; expected: [0.0, 1.0], got: %f", result); } - /* Clean up */ + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + return TEST_COMPLETED; } @@ -544,7 +544,7 @@ video_getWindowBrightnessNegative(void *arg) const char* title = "video_getWindowBrightnessNegative Test Window"; float result; - /* Call against invalid window */ + /* Call against invalid window */ result = SDL_GetWindowBrightness(NULL); SDLTest_AssertPass("Call to SDL_GetWindowBrightness(window=NULL)"); SDLTest_AssertCheck(result == 1.0, "Validate result value; expected: 1.0, got: %f", result); @@ -579,7 +579,7 @@ video_getWindowDisplayMode(void *arg) mode.h = -1; mode.refresh_rate = -1; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window != NULL) { result = SDL_GetWindowDisplayMode(window, &mode); @@ -590,9 +590,9 @@ video_getWindowDisplayMode(void *arg) SDLTest_AssertCheck(mode.refresh_rate > 0, "Validate mode.refresh_rate content; expected: >0, got: %d", mode.refresh_rate); } - /* Clean up */ + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + return TEST_COMPLETED; } @@ -611,7 +611,7 @@ void _checkInvalidWindowError() invalidWindowError, lastError); SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); + SDLTest_AssertPass("Call to SDL_ClearError()"); } } @@ -630,7 +630,7 @@ video_getWindowDisplayModeNegative(void *arg) SDL_DisplayMode mode; int result; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window != NULL) { result = SDL_GetWindowDisplayMode(window, NULL); @@ -640,16 +640,16 @@ video_getWindowDisplayModeNegative(void *arg) SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL"); if (lastError != NULL) { - SDLTest_AssertCheck(SDL_strcmp(lastError, expectedError) == 0, + SDLTest_AssertCheck(SDL_strcmp(lastError, expectedError) == 0, "SDL_GetError(): expected message '%s', was message: '%s'", expectedError, lastError); } } - /* Clean up */ + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + /* Call against invalid window */ result = SDL_GetWindowDisplayMode(NULL, &mode); SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode(window=NULL,...)"); @@ -674,10 +674,10 @@ video_getWindowGammaRamp(void *arg) Uint16 blue[256]; int result; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window == NULL) return TEST_ABORTED; - + /* Retrieve no channel */ result = SDL_GetWindowGammaRamp(window, NULL, NULL, NULL); SDLTest_AssertPass("Call to SDL_GetWindowGammaRamp(all NULL)"); @@ -714,9 +714,9 @@ video_getWindowGammaRamp(void *arg) SDLTest_AssertPass("Call to SDL_GetWindowGammaRamp(r,g,b)"); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0, got: %d", result); - /* Clean up */ + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + return TEST_COMPLETED; } @@ -737,21 +737,21 @@ video_getWindowGammaRampNegative(void *arg) SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); - /* Call against invalid window */ + /* Call against invalid window */ result = SDL_GetWindowGammaRamp(NULL, red, green, blue); SDLTest_AssertPass("Call to SDL_GetWindowGammaRamp(window=NULL,r,g,b)"); SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %f", result); _checkInvalidWindowError(); - + return TEST_COMPLETED; } /* Helper for setting and checking the window grab state */ -void +void _setAndCheckWindowGrabState(SDL_Window* window, SDL_bool desiredState) { SDL_bool currentState; - + /* Set state */ SDL_SetWindowGrab(window, desiredState); SDLTest_AssertPass("Call to SDL_SetWindowGrab(%s)", (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); @@ -760,8 +760,8 @@ _setAndCheckWindowGrabState(SDL_Window* window, SDL_bool desiredState) currentState = SDL_GetWindowGrab(window); SDLTest_AssertPass("Call to SDL_GetWindowGrab()"); SDLTest_AssertCheck( - currentState == desiredState, - "Validate returned state; expected: %s, got: %s", + currentState == desiredState, + "Validate returned state; expected: %s, got: %s", (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE", (currentState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); } @@ -779,11 +779,11 @@ video_getSetWindowGrab(void *arg) SDL_Window* window; SDL_bool originalState, dummyState, currentState, desiredState; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window == NULL) return TEST_ABORTED; - /* Get state */ + /* Get state */ originalState = SDL_GetWindowGrab(window); SDLTest_AssertPass("Call to SDL_GetWindowGrab()"); @@ -792,7 +792,7 @@ video_getSetWindowGrab(void *arg) /* F --> F */ _setAndCheckWindowGrabState(window, SDL_FALSE); - + /* F --> T */ _setAndCheckWindowGrabState(window, SDL_TRUE); @@ -801,7 +801,7 @@ video_getSetWindowGrab(void *arg) /* T --> F */ _setAndCheckWindowGrabState(window, SDL_FALSE); - + /* Negative tests */ dummyState = SDL_GetWindowGrab(NULL); SDLTest_AssertPass("Call to SDL_GetWindowGrab(window=NULL)"); @@ -814,21 +814,21 @@ video_getSetWindowGrab(void *arg) SDL_SetWindowGrab(NULL, SDL_TRUE); SDLTest_AssertPass("Call to SDL_SetWindowGrab(window=NULL,SDL_FALSE)"); _checkInvalidWindowError(); - + /* State should still be F */ desiredState = SDL_FALSE; currentState = SDL_GetWindowGrab(window); SDLTest_AssertPass("Call to SDL_GetWindowGrab()"); SDLTest_AssertCheck( - currentState == desiredState, - "Validate returned state; expected: %s, got: %s", + currentState == desiredState, + "Validate returned state; expected: %s, got: %s", (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE", (currentState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); - - /* Restore state */ + + /* Restore state */ _setAndCheckWindowGrabState(window, originalState); - /* Clean up */ + /* Clean up */ _destroyVideoSuiteTestWindow(window); return TEST_COMPLETED; @@ -849,7 +849,7 @@ video_getWindowId(void *arg) SDL_Window* result; Uint32 id, randomId; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window == NULL) return TEST_ABORTED; @@ -873,9 +873,9 @@ video_getWindowId(void *arg) result = SDL_GetWindowFromID(UINT32_MAX); SDLTest_AssertPass("Call to SDL_GetWindowID(UINT32_MAX)"); - /* Clean up */ + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + /* Get window from ID for closed window*/ result = SDL_GetWindowFromID(id); SDLTest_AssertPass("Call to SDL_GetWindowID(%d/closed_window)", id); @@ -887,7 +887,7 @@ video_getWindowId(void *arg) id = SDL_GetWindowID(NULL); SDLTest_AssertPass("Call to SDL_GetWindowID(window=NULL)"); _checkInvalidWindowError(); - + return TEST_COMPLETED; } @@ -903,7 +903,7 @@ video_getWindowPixelFormat(void *arg) SDL_Window* window; Uint32 format; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window == NULL) return TEST_ABORTED; @@ -911,10 +911,10 @@ video_getWindowPixelFormat(void *arg) format = SDL_GetWindowPixelFormat(window); SDLTest_AssertPass("Call to SDL_GetWindowPixelFormat()"); SDLTest_AssertCheck(format != SDL_PIXELFORMAT_UNKNOWN, "Verify that returned format is valid; expected: != %d, got: %d", SDL_PIXELFORMAT_UNKNOWN, format); - - /* Clean up */ + + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + /* Negative test */ SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); @@ -941,46 +941,46 @@ video_getSetWindowPosition(void *arg) int currentX, currentY; int desiredX, desiredY; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window == NULL) return TEST_ABORTED; - + for (xVariation = 0; xVariation < 4; xVariation++) { for (yVariation = 0; yVariation < 4; yVariation++) { switch(xVariation) { case 0: - /* Zero X Position */ + /* Zero X Position */ desiredX = 0; break; case 1: - /* Random X position inside screen */ + /* Random X position inside screen */ desiredX = SDLTest_RandomIntegerInRange(1, 100); break; case 2: - /* Random X position outside screen (positive) */ + /* Random X position outside screen (positive) */ desiredX = SDLTest_RandomIntegerInRange(10000, 11000); break; case 3: - /* Random X position outside screen (negative) */ + /* Random X position outside screen (negative) */ desiredX = SDLTest_RandomIntegerInRange(-1000, -100); break; } switch(yVariation) { case 0: - /* Zero X Position */ + /* Zero X Position */ desiredY = 0; break; case 1: - /* Random X position inside screen */ + /* Random X position inside screen */ desiredY = SDLTest_RandomIntegerInRange(1, 100); break; case 2: - /* Random X position outside screen (positive) */ + /* Random X position outside screen (positive) */ desiredY = SDLTest_RandomIntegerInRange(10000, 11000); break; case 3: - /* Random Y position outside screen (negative) */ + /* Random Y position outside screen (negative) */ desiredY = SDLTest_RandomIntegerInRange(-1000, -100); break; } @@ -988,7 +988,7 @@ video_getSetWindowPosition(void *arg) /* Set position */ SDL_SetWindowPosition(window, desiredX, desiredY); SDLTest_AssertPass("Call to SDL_SetWindowPosition(...,%d,%d)", desiredX, desiredY); - + /* Get position */ currentX = desiredX + 1; currentY = desiredY + 1; @@ -998,7 +998,7 @@ video_getSetWindowPosition(void *arg) SDLTest_AssertCheck(desiredY == currentY, "Verify returned Y position; expected: %d, got: %d", desiredY, currentY); /* Get position X */ - currentX = desiredX + 1; + currentX = desiredX + 1; SDL_GetWindowPosition(window, ¤tX, NULL); SDLTest_AssertPass("Call to SDL_GetWindowPosition(&y=NULL)"); SDLTest_AssertCheck(desiredX == currentX, "Verify returned X position; expected: %d, got: %d", desiredX, currentX); @@ -1014,10 +1014,10 @@ video_getSetWindowPosition(void *arg) /* Dummy call with both pointers NULL */ SDL_GetWindowPosition(window, NULL, NULL); SDLTest_AssertPass("Call to SDL_GetWindowPosition(&x=NULL,&y=NULL)"); - - /* Clean up */ + + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + /* Set some 'magic' value for later check that nothing was changed */ referenceX = SDLTest_RandomSint32(); referenceY = SDLTest_RandomSint32(); @@ -1028,14 +1028,14 @@ video_getSetWindowPosition(void *arg) /* Negative tests */ SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); + SDLTest_AssertPass("Call to SDL_ClearError()"); SDL_GetWindowPosition(NULL, ¤tX, ¤tY); SDLTest_AssertPass("Call to SDL_GetWindowPosition(window=NULL)"); SDLTest_AssertCheck( - currentX == referenceX && currentY == referenceY, - "Verify that content of X and Y pointers has not been modified; expected: %d,%d; got: %d,%d", - referenceX, referenceY, - currentX, currentY); + currentX == referenceX && currentY == referenceY, + "Verify that content of X and Y pointers has not been modified; expected: %d,%d; got: %d,%d", + referenceX, referenceY, + currentX, currentY); _checkInvalidWindowError(); SDL_GetWindowPosition(NULL, NULL, NULL); @@ -1045,7 +1045,7 @@ video_getSetWindowPosition(void *arg) SDL_SetWindowPosition(NULL, desiredX, desiredY); SDLTest_AssertPass("Call to SDL_SetWindowPosition(window=NULL)"); _checkInvalidWindowError(); - + return TEST_COMPLETED; } @@ -1064,7 +1064,7 @@ void _checkInvalidParameterError() invalidParameterError, lastError); SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); + SDLTest_AssertPass("Call to SDL_ClearError()"); } } @@ -1081,6 +1081,7 @@ video_getSetWindowSize(void *arg) SDL_Window* window; int result; SDL_Rect display; + int maxwVariation, maxhVariation; int wVariation, hVariation; int referenceW, referenceH; int currentW, currentH; @@ -1091,47 +1092,65 @@ video_getSetWindowSize(void *arg) SDLTest_AssertPass("SDL_GetDisplayBounds()"); SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); if (result != 0) return TEST_ABORTED; - - /* Call against new test window */ + + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window == NULL) return TEST_ABORTED; + +#ifdef __WIN32__ + /* Platform clips window size to screen size */ + maxwVariation = 4; + maxhVariation = 4; +#else + /* Platform allows window size >= screen size */ + maxwVariation = 5; + maxhVariation = 5; +#endif - for (wVariation = 0; wVariation < 4; wVariation++) { - for (hVariation = 0; hVariation < 4; hVariation++) { + for (wVariation = 0; wVariation < maxwVariation; wVariation++) { + for (hVariation = 0; hVariation < maxhVariation; hVariation++) { switch(wVariation) { case 0: - /* 1 Pixel Wide */ + /* 1 Pixel Wide */ desiredW = 1; break; case 1: - /* Random width inside screen */ + /* Random width inside screen */ desiredW = SDLTest_RandomIntegerInRange(1, 100); break; case 2: - /* Width at screen size */ - desiredW = display.w; + /* Width 1 pixel smaller than screen */ + desiredW = display.w - 1; break; case 3: - /* Width 1 pixel larger than screen */ + /* Width at screen size */ + desiredW = display.w; + break; + case 4: + /* Width 1 pixel larger than screen */ desiredW = display.w + 1; break; } switch(hVariation) { case 0: - /* 1 Pixel High */ + /* 1 Pixel High */ desiredH = 1; break; case 1: - /* Random height inside screen */ + /* Random height inside screen */ desiredH = SDLTest_RandomIntegerInRange(1, 100); break; case 2: - /* Height at screen size */ - desiredH = display.h; + /* Height 1 pixel smaller than screen */ + desiredH = display.h - 1; break; case 3: - /* Height 1 pixel larger than screen */ + /* Height at screen size */ + desiredH = display.h; + break; + case 4: + /* Height 1 pixel larger than screen */ desiredH = display.h + 1; break; } @@ -1139,7 +1158,7 @@ video_getSetWindowSize(void *arg) /* Set size */ SDL_SetWindowSize(window, desiredW, desiredH); SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH); - + /* Get size */ currentW = desiredW + 1; currentH = desiredH + 1; @@ -1149,16 +1168,16 @@ video_getSetWindowSize(void *arg) SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); /* Get just width */ - currentW = desiredW + 1; + currentW = desiredW + 1; SDL_GetWindowSize(window, ¤tW, NULL); SDLTest_AssertPass("Call to SDL_GetWindowSize(&h=NULL)"); - SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH); + SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); /* Get just height */ currentH = desiredH + 1; SDL_GetWindowSize(window, NULL, ¤tH); SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL)"); - SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH); + SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); } } @@ -1168,20 +1187,20 @@ video_getSetWindowSize(void *arg) /* Negative tests for parameter input */ SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); + SDLTest_AssertPass("Call to SDL_ClearError()"); for (desiredH = -2; desiredH < 2; desiredH++) { for (desiredW = -2; desiredW < 2; desiredW++) { - if (desiredW <= 0 || desiredH <= 0) { + if (desiredW <= 0 || desiredH <= 0) { SDL_SetWindowSize(window, desiredW, desiredH); SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH); _checkInvalidParameterError(); } } } - - /* Clean up */ + + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + /* Set some 'magic' value for later check that nothing was changed */ referenceW = SDLTest_RandomSint32(); referenceH = SDLTest_RandomSint32(); @@ -1189,17 +1208,17 @@ video_getSetWindowSize(void *arg) currentH = referenceH; desiredW = SDLTest_RandomSint32(); desiredH = SDLTest_RandomSint32(); - + /* Negative tests for window input */ SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); SDL_GetWindowSize(NULL, ¤tW, ¤tH); SDLTest_AssertPass("Call to SDL_GetWindowSize(window=NULL)"); SDLTest_AssertCheck( - currentW == referenceW && currentH == referenceH, - "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", - referenceW, referenceH, - currentW, currentH); + currentW == referenceW && currentH == referenceH, + "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", + referenceW, referenceH, + currentW, currentH); _checkInvalidWindowError(); SDL_GetWindowSize(NULL, NULL, NULL); @@ -1209,7 +1228,7 @@ video_getSetWindowSize(void *arg) SDL_SetWindowSize(NULL, desiredW, desiredH); SDLTest_AssertPass("Call to SDL_SetWindowSize(window=NULL)"); _checkInvalidWindowError(); - + return TEST_COMPLETED; } @@ -1235,42 +1254,42 @@ video_getSetWindowMinimumSize(void *arg) SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); if (result != 0) return TEST_ABORTED; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window == NULL) return TEST_ABORTED; - + for (wVariation = 0; wVariation < 5; wVariation++) { for (hVariation = 0; hVariation < 5; hVariation++) { switch(wVariation) { case 0: - /* 1 Pixel Wide */ + /* 1 Pixel Wide */ desiredW = 1; break; case 1: - /* Random width inside screen */ + /* Random width inside screen */ desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1); break; case 2: - /* Width at screen size */ + /* Width at screen size */ desiredW = display.w; break; } switch(hVariation) { case 0: - /* 1 Pixel High */ + /* 1 Pixel High */ desiredH = 1; break; case 1: - /* Random height inside screen */ + /* Random height inside screen */ desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1); break; case 2: - /* Height at screen size */ + /* Height at screen size */ desiredH = display.h; break; case 4: - /* Height 1 pixel larger than screen */ + /* Height 1 pixel larger than screen */ desiredH = display.h + 1; break; } @@ -1278,7 +1297,7 @@ video_getSetWindowMinimumSize(void *arg) /* Set size */ SDL_SetWindowMinimumSize(window, desiredW, desiredH); SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH); - + /* Get size */ currentW = desiredW + 1; currentH = desiredH + 1; @@ -1288,7 +1307,7 @@ video_getSetWindowMinimumSize(void *arg) SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); /* Get just width */ - currentW = desiredW + 1; + currentW = desiredW + 1; SDL_GetWindowMinimumSize(window, ¤tW, NULL); SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&h=NULL)"); SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH); @@ -1307,20 +1326,20 @@ video_getSetWindowMinimumSize(void *arg) /* Negative tests for parameter input */ SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); + SDLTest_AssertPass("Call to SDL_ClearError()"); for (desiredH = -2; desiredH < 2; desiredH++) { for (desiredW = -2; desiredW < 2; desiredW++) { - if (desiredW <= 0 || desiredH <= 0) { + if (desiredW <= 0 || desiredH <= 0) { SDL_SetWindowMinimumSize(window, desiredW, desiredH); SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH); _checkInvalidParameterError(); } } } - - /* Clean up */ + + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + /* Set some 'magic' value for later check that nothing was changed */ referenceW = SDLTest_RandomSint32(); referenceH = SDLTest_RandomSint32(); @@ -1328,17 +1347,17 @@ video_getSetWindowMinimumSize(void *arg) currentH = referenceH; desiredW = SDLTest_RandomSint32(); desiredH = SDLTest_RandomSint32(); - + /* Negative tests for window input */ SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); SDL_GetWindowMinimumSize(NULL, ¤tW, ¤tH); SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(window=NULL)"); SDLTest_AssertCheck( - currentW == referenceW && currentH == referenceH, - "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", - referenceW, referenceH, - currentW, currentH); + currentW == referenceW && currentH == referenceH, + "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", + referenceW, referenceH, + currentW, currentH); _checkInvalidWindowError(); SDL_GetWindowMinimumSize(NULL, NULL, NULL); @@ -1348,7 +1367,7 @@ video_getSetWindowMinimumSize(void *arg) SDL_SetWindowMinimumSize(NULL, desiredW, desiredH); SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(window=NULL)"); _checkInvalidWindowError(); - + return TEST_COMPLETED; } @@ -1374,38 +1393,38 @@ video_getSetWindowMaximumSize(void *arg) SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); if (result != 0) return TEST_ABORTED; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window == NULL) return TEST_ABORTED; - + for (wVariation = 0; wVariation < 3; wVariation++) { for (hVariation = 0; hVariation < 3; hVariation++) { switch(wVariation) { case 0: - /* 1 Pixel Wide */ + /* 1 Pixel Wide */ desiredW = 1; break; case 1: - /* Random width inside screen */ + /* Random width inside screen */ desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1); break; case 2: - /* Width at screen size */ + /* Width at screen size */ desiredW = display.w; break; } switch(hVariation) { case 0: - /* 1 Pixel High */ + /* 1 Pixel High */ desiredH = 1; break; case 1: - /* Random height inside screen */ + /* Random height inside screen */ desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1); break; case 2: - /* Height at screen size */ + /* Height at screen size */ desiredH = display.h; break; } @@ -1413,7 +1432,7 @@ video_getSetWindowMaximumSize(void *arg) /* Set size */ SDL_SetWindowMaximumSize(window, desiredW, desiredH); SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH); - + /* Get size */ currentW = desiredW + 1; currentH = desiredH + 1; @@ -1423,7 +1442,7 @@ video_getSetWindowMaximumSize(void *arg) SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); /* Get just width */ - currentW = desiredW + 1; + currentW = desiredW + 1; SDL_GetWindowMaximumSize(window, ¤tW, NULL); SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&h=NULL)"); SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH); @@ -1442,20 +1461,20 @@ video_getSetWindowMaximumSize(void *arg) /* Negative tests for parameter input */ SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); + SDLTest_AssertPass("Call to SDL_ClearError()"); for (desiredH = -2; desiredH < 2; desiredH++) { for (desiredW = -2; desiredW < 2; desiredW++) { - if (desiredW <= 0 || desiredH <= 0) { + if (desiredW <= 0 || desiredH <= 0) { SDL_SetWindowMaximumSize(window, desiredW, desiredH); SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH); _checkInvalidParameterError(); } } } - - /* Clean up */ + + /* Clean up */ _destroyVideoSuiteTestWindow(window); - + /* Set some 'magic' value for later check that nothing was changed */ referenceW = SDLTest_RandomSint32(); referenceH = SDLTest_RandomSint32(); @@ -1463,17 +1482,17 @@ video_getSetWindowMaximumSize(void *arg) currentH = referenceH; desiredW = SDLTest_RandomSint32(); desiredH = SDLTest_RandomSint32(); - + /* Negative tests */ SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); SDL_GetWindowMaximumSize(NULL, ¤tW, ¤tH); SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(window=NULL)"); SDLTest_AssertCheck( - currentW == referenceW && currentH == referenceH, - "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", - referenceW, referenceH, - currentW, currentH); + currentW == referenceW && currentH == referenceH, + "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", + referenceW, referenceH, + currentW, currentH); _checkInvalidWindowError(); SDL_GetWindowMaximumSize(NULL, NULL, NULL); @@ -1483,7 +1502,7 @@ video_getSetWindowMaximumSize(void *arg) SDL_SetWindowMaximumSize(NULL, desiredW, desiredH); SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(window=NULL)"); _checkInvalidWindowError(); - + return TEST_COMPLETED; } @@ -1512,47 +1531,47 @@ video_getSetWindowData(void *arg) char *result; int iteration; - /* Call against new test window */ + /* Call against new test window */ window = _createVideoSuiteTestWindow(title); if (window == NULL) return TEST_ABORTED; /* Create testdata */ - datasize = SDLTest_RandomIntegerInRange(1, 32); + datasize = SDLTest_RandomIntegerInRange(1, 32); referenceUserdata = SDLTest_RandomAsciiStringOfSize(datasize); - if (referenceUserdata == NULL) { - returnValue = TEST_ABORTED; - goto cleanup; + if (referenceUserdata == NULL) { + returnValue = TEST_ABORTED; + goto cleanup; } userdata = SDL_strdup(referenceUserdata); if (userdata == NULL) { - returnValue = TEST_ABORTED; - goto cleanup; + returnValue = TEST_ABORTED; + goto cleanup; } - datasize = SDLTest_RandomIntegerInRange(1, 32); + datasize = SDLTest_RandomIntegerInRange(1, 32); referenceUserdata2 = SDLTest_RandomAsciiStringOfSize(datasize); - if (referenceUserdata2 == NULL) { - returnValue = TEST_ABORTED; - goto cleanup; + if (referenceUserdata2 == NULL) { + returnValue = TEST_ABORTED; + goto cleanup; } - userdata2 = (char *)strdup(referenceUserdata2); + userdata2 = (char *)SDL_strdup(referenceUserdata2); if (userdata2 == NULL) { - returnValue = TEST_ABORTED; - goto cleanup; + returnValue = TEST_ABORTED; + goto cleanup; } - + /* Get non-existent data */ result = (char *)SDL_GetWindowData(window, name); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - + /* Set data */ - result = SDL_SetWindowData(window, name, userdata); + result = (char *)SDL_SetWindowData(window, name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s)", name, userdata); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); - + /* Get data (twice) */ for (iteration = 1; iteration <= 2; iteration++) { result = (char *)SDL_GetWindowData(window, name); @@ -1560,16 +1579,16 @@ video_getSetWindowData(void *arg) SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); } - + /* Set data again twice */ for (iteration = 1; iteration <= 2; iteration++) { - result = SDL_SetWindowData(window, name, userdata); + result = (char *)SDL_SetWindowData(window, name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [iteration %d]", name, userdata, iteration); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); } - + /* Get data again */ result = (char *)SDL_GetWindowData(window, name); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again]", name); @@ -1577,7 +1596,7 @@ video_getSetWindowData(void *arg) SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data with new data */ - result = SDL_SetWindowData(window, name, userdata2); + result = (char *)SDL_SetWindowData(window, name, userdata2); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata]", name, userdata2); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); @@ -1585,13 +1604,13 @@ video_getSetWindowData(void *arg) SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Set data with new data again */ - result = SDL_SetWindowData(window, name, userdata2); + result = (char *)SDL_SetWindowData(window, name, userdata2); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata again]", name, userdata2); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - + /* Get new data */ result = (char *)SDL_GetWindowData(window, name); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); @@ -1599,7 +1618,7 @@ video_getSetWindowData(void *arg) SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data with NULL to clear */ - result = SDL_SetWindowData(window, name, NULL); + result = (char *)SDL_SetWindowData(window, name, NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); @@ -1607,13 +1626,13 @@ video_getSetWindowData(void *arg) SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Set data with NULL to clear again */ - result = SDL_SetWindowData(window, name, NULL); + result = (char *)SDL_SetWindowData(window, name, NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name, userdata); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - + /* Get non-existent data */ result = (char *)SDL_GetWindowData(window, name); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); @@ -1627,12 +1646,12 @@ video_getSetWindowData(void *arg) SDLTest_AssertCheck(SDL_strcmp(referenceName2, name2) == 0, "Validate that name2 was not changed, expected: %s, got: %s", referenceName2, name2); /* Set data (again) */ - result = SDL_SetWindowData(window, name, userdata); + result = (char *)SDL_SetWindowData(window, name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [again, after clear]", name, userdata); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); - + /* Get data (again) */ result = (char *)SDL_GetWindowData(window, name); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again, after clear]", name); @@ -1643,63 +1662,63 @@ video_getSetWindowData(void *arg) SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); - /* Set with invalid window */ - result = SDL_SetWindowData(NULL, name, userdata); + /* Set with invalid window */ + result = (char *)SDL_SetWindowData(NULL, name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(window=NULL)"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); _checkInvalidWindowError(); - + /* Set data with NULL name, valid userdata */ - result = SDL_SetWindowData(window, NULL, userdata); + result = (char *)SDL_SetWindowData(window, NULL, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL)"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); _checkInvalidParameterError(); /* Set data with empty name, valid userdata */ - result = SDL_SetWindowData(window, "", userdata); + result = (char *)SDL_SetWindowData(window, "", userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(name='')"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); _checkInvalidParameterError(); /* Set data with NULL name, NULL userdata */ - result = SDL_SetWindowData(window, NULL, NULL); + result = (char *)SDL_SetWindowData(window, NULL, NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL,userdata=NULL)"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); _checkInvalidParameterError(); /* Set data with empty name, NULL userdata */ - result = SDL_SetWindowData(window, "", NULL); + result = (char *)SDL_SetWindowData(window, "", NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(name='',userdata=NULL)"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); _checkInvalidParameterError(); /* Get with invalid window */ - result = SDL_GetWindowData(NULL, name); + result = (char *)SDL_GetWindowData(NULL, name); SDLTest_AssertPass("Call to SDL_GetWindowData(window=NULL)"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); _checkInvalidWindowError(); - + /* Get data with NULL name */ - result = SDL_GetWindowData(window, NULL); + result = (char *)SDL_GetWindowData(window, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(name=NULL)"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); _checkInvalidParameterError(); /* Get data with empty name */ - result = SDL_GetWindowData(window, ""); + result = (char *)SDL_GetWindowData(window, ""); SDLTest_AssertPass("Call to SDL_GetWindowData(name='')"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); _checkInvalidParameterError(); /* Clean up */ _destroyVideoSuiteTestWindow(window); - + cleanup: if (referenceUserdata != NULL) SDL_free(referenceUserdata); if (referenceUserdata2 != NULL) SDL_free(referenceUserdata2); if (userdata != NULL) SDL_free(userdata); - if (userdata != NULL) SDL_free(userdata); - + if (userdata2 != NULL) SDL_free(userdata2); + return returnValue; } @@ -1708,87 +1727,87 @@ video_getSetWindowData(void *arg) /* Video test cases */ static const SDLTest_TestCaseReference videoTest1 = - { (SDLTest_TestCaseFp)video_enableDisableScreensaver, "video_enableDisableScreensaver", "Enable and disable screenaver while checking state", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_enableDisableScreensaver, "video_enableDisableScreensaver", "Enable and disable screenaver while checking state", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest2 = - { (SDLTest_TestCaseFp)video_createWindowVariousPositions, "video_createWindowVariousPositions", "Create windows at various locations", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_createWindowVariousPositions, "video_createWindowVariousPositions", "Create windows at various locations", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest3 = - { (SDLTest_TestCaseFp)video_createWindowVariousSizes, "video_createWindowVariousSizes", "Create windows with various sizes", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_createWindowVariousSizes, "video_createWindowVariousSizes", "Create windows with various sizes", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest4 = - { (SDLTest_TestCaseFp)video_createWindowVariousFlags, "video_createWindowVariousFlags", "Create windows using various flags", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_createWindowVariousFlags, "video_createWindowVariousFlags", "Create windows using various flags", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest5 = - { (SDLTest_TestCaseFp)video_getWindowFlags, "video_getWindowFlags", "Get window flags set during SDL_CreateWindow", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getWindowFlags, "video_getWindowFlags", "Get window flags set during SDL_CreateWindow", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest6 = - { (SDLTest_TestCaseFp)video_getNumDisplayModes, "video_getNumDisplayModes", "Use SDL_GetNumDisplayModes function to get number of display modes", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getNumDisplayModes, "video_getNumDisplayModes", "Use SDL_GetNumDisplayModes function to get number of display modes", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest7 = - { (SDLTest_TestCaseFp)video_getNumDisplayModesNegative, "video_getNumDisplayModesNegative", "Negative tests for SDL_GetNumDisplayModes", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getNumDisplayModesNegative, "video_getNumDisplayModesNegative", "Negative tests for SDL_GetNumDisplayModes", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest8 = - { (SDLTest_TestCaseFp)video_getClosestDisplayModeCurrentResolution, "video_getClosestDisplayModeCurrentResolution", "Use function to get closes match to requested display mode for current resolution", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getClosestDisplayModeCurrentResolution, "video_getClosestDisplayModeCurrentResolution", "Use function to get closes match to requested display mode for current resolution", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest9 = - { (SDLTest_TestCaseFp)video_getClosestDisplayModeRandomResolution, "video_getClosestDisplayModeRandomResolution", "Use function to get closes match to requested display mode for random resolution", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getClosestDisplayModeRandomResolution, "video_getClosestDisplayModeRandomResolution", "Use function to get closes match to requested display mode for random resolution", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest10 = - { (SDLTest_TestCaseFp)video_getWindowBrightness, "video_getWindowBrightness", "Get window brightness", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getWindowBrightness, "video_getWindowBrightness", "Get window brightness", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest11 = - { (SDLTest_TestCaseFp)video_getWindowBrightnessNegative, "video_getWindowBrightnessNegative", "Get window brightness with invalid input", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getWindowBrightnessNegative, "video_getWindowBrightnessNegative", "Get window brightness with invalid input", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest12 = - { (SDLTest_TestCaseFp)video_getWindowDisplayMode, "video_getWindowDisplayMode", "Get window display mode", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getWindowDisplayMode, "video_getWindowDisplayMode", "Get window display mode", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest13 = - { (SDLTest_TestCaseFp)video_getWindowDisplayModeNegative, "video_getWindowDisplayModeNegative", "Get window display mode with invalid input", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getWindowDisplayModeNegative, "video_getWindowDisplayModeNegative", "Get window display mode with invalid input", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest14 = - { (SDLTest_TestCaseFp)video_getWindowGammaRamp, "video_getWindowGammaRamp", "Get window gamma ramp", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getWindowGammaRamp, "video_getWindowGammaRamp", "Get window gamma ramp", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest15 = - { (SDLTest_TestCaseFp)video_getWindowGammaRampNegative, "video_getWindowGammaRampNegative", "Get window gamma ramp against invalid input", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getWindowGammaRampNegative, "video_getWindowGammaRampNegative", "Get window gamma ramp against invalid input", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest16 = - { (SDLTest_TestCaseFp)video_getSetWindowGrab, "video_getSetWindowGrab", "Checks SDL_GetWindowGrab and SDL_SetWindowGrab positive and negative cases", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getSetWindowGrab, "video_getSetWindowGrab", "Checks SDL_GetWindowGrab and SDL_SetWindowGrab positive and negative cases", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest17 = - { (SDLTest_TestCaseFp)video_getWindowId, "video_getWindowId", "Checks SDL_GetWindowID and SDL_GetWindowFromID", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getWindowId, "video_getWindowId", "Checks SDL_GetWindowID and SDL_GetWindowFromID", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest18 = - { (SDLTest_TestCaseFp)video_getWindowPixelFormat, "video_getWindowPixelFormat", "Checks SDL_GetWindowPixelFormat", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getWindowPixelFormat, "video_getWindowPixelFormat", "Checks SDL_GetWindowPixelFormat", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest19 = - { (SDLTest_TestCaseFp)video_getSetWindowPosition, "video_getSetWindowPosition", "Checks SDL_GetWindowPosition and SDL_SetWindowPosition positive and negative cases", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getSetWindowPosition, "video_getSetWindowPosition", "Checks SDL_GetWindowPosition and SDL_SetWindowPosition positive and negative cases", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest20 = - { (SDLTest_TestCaseFp)video_getSetWindowSize, "video_getSetWindowSize", "Checks SDL_GetWindowSize and SDL_SetWindowSize positive and negative cases", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getSetWindowSize, "video_getSetWindowSize", "Checks SDL_GetWindowSize and SDL_SetWindowSize positive and negative cases", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest21 = - { (SDLTest_TestCaseFp)video_getSetWindowMinimumSize, "video_getSetWindowMinimumSize", "Checks SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize positive and negative cases", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getSetWindowMinimumSize, "video_getSetWindowMinimumSize", "Checks SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize positive and negative cases", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest22 = - { (SDLTest_TestCaseFp)video_getSetWindowMaximumSize, "video_getSetWindowMaximumSize", "Checks SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize positive and negative cases", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getSetWindowMaximumSize, "video_getSetWindowMaximumSize", "Checks SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize positive and negative cases", TEST_ENABLED }; static const SDLTest_TestCaseReference videoTest23 = - { (SDLTest_TestCaseFp)video_getSetWindowData, "video_getSetWindowData", "Checks SDL_SetWindowData and SDL_GetWindowData positive and negative cases", TEST_ENABLED }; + { (SDLTest_TestCaseFp)video_getSetWindowData, "video_getSetWindowData", "Checks SDL_SetWindowData and SDL_GetWindowData positive and negative cases", TEST_ENABLED }; /* Sequence of Video test cases */ static const SDLTest_TestCaseReference *videoTests[] = { - &videoTest1, &videoTest2, &videoTest3, &videoTest4, &videoTest5, &videoTest6, - &videoTest7, &videoTest8, &videoTest9, &videoTest10, &videoTest11, &videoTest12, - &videoTest13, &videoTest14, &videoTest15, &videoTest16, &videoTest17, - &videoTest18, &videoTest19, &videoTest20, &videoTest21, &videoTest22, - &videoTest23, NULL + &videoTest1, &videoTest2, &videoTest3, &videoTest4, &videoTest5, &videoTest6, + &videoTest7, &videoTest8, &videoTest9, &videoTest10, &videoTest11, &videoTest12, + &videoTest13, &videoTest14, &videoTest15, &videoTest16, &videoTest17, + &videoTest18, &videoTest19, &videoTest20, &videoTest21, &videoTest22, + &videoTest23, NULL }; /* Video test suite (global) */ SDLTest_TestSuiteReference videoTestSuite = { - "Video", - NULL, - videoTests, - NULL + "Video", + NULL, + videoTests, + NULL }; diff --git a/test/testdraw2.c b/test/testdraw2.c index 3fced878d..a4509fe74 100644 --- a/test/testdraw2.c +++ b/test/testdraw2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -18,7 +18,7 @@ #include "SDL_test_common.h" -#define NUM_OBJECTS 100 +#define NUM_OBJECTS 100 static SDLTest_CommonState *state; static int num_objects; diff --git a/test/testdrawchessboard.c b/test/testdrawchessboard.c new file mode 100644 index 000000000..002d8d717 --- /dev/null +++ b/test/testdrawchessboard.c @@ -0,0 +1,107 @@ +/* + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. + + This file is created by : Nitin Jain (nitin.j4@samsung.com) +*/ + +/* Sample program: Draw a Chess Board by using SDL_CreateSoftwareRenderer API */ + +#include +#include + +#include "SDL.h" + +void +DrawChessBoard(SDL_Renderer * renderer) +{ + int row = 0,coloum = 0,x = 0; + SDL_Rect rect, darea; + + /* Get the Size of drawing surface */ + SDL_RenderGetViewport(renderer, &darea); + + for(row; row < 8; row++) + { + coloum = row%2; + x = x + coloum; + for(coloum; coloum < 4+(row%2); coloum++) + { + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); + + rect.w = darea.w/8; + rect.h = darea.h/8; + rect.x = x * rect.w; + rect.y = row * rect.h; + x = x + 2; + SDL_RenderFillRect(renderer, &rect); + } + x=0; + } +} + +int +main(int argc, char *argv[]) +{ + SDL_Window *window; + SDL_Surface *surface; + SDL_Renderer *renderer; + + /* Initialize SDL */ + if(SDL_Init(SDL_INIT_VIDEO) != 0) + { + fprintf(stderr,"SDL_Init fail : %s\n", SDL_GetError()); + return 1; + } + + + /* Create window and renderer for given surface */ + window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN); + if(!window) + { + fprintf(stderr,"Window creation fail : %s\n",SDL_GetError()); + return 1; + } + surface = SDL_GetWindowSurface(window); + renderer = SDL_CreateSoftwareRenderer(surface); + if(!renderer) + { + fprintf(stderr,"Render creation for surface fail : %s\n",SDL_GetError()); + return 1; + } + + /* Clear the rendering surface with the specified color */ + SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0); + SDL_RenderClear(renderer); + + + /* Draw the Image on rendering surface */ + while(1) + { + SDL_Event e; + if (SDL_PollEvent(&e)) { + if (e.type == SDL_QUIT) + break; + + if(e.key.keysym.sym == SDLK_ESCAPE) + break; + } + + DrawChessBoard(renderer); + + /* Got everything on rendering surface, + now Update the drawing image on window screen */ + SDL_UpdateWindowSurface(window); + + } + + return 0; +} + diff --git a/test/testerror.c b/test/testerror.c index d96fcc59b..e7356c06b 100644 --- a/test/testerror.c +++ b/test/testerror.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testfile.c b/test/testfile.c index 3ee75ba91..d82d0eb7c 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,11 +30,11 @@ /* WARNING ! those 2 files will be destroyed by this test program */ #ifdef __IPHONEOS__ -#define FBASENAME1 "../Documents/sdldata1" /* this file will be created during tests */ +#define FBASENAME1 "../Documents/sdldata1" /* this file will be created during tests */ #define FBASENAME2 "../Documents/sdldata2" /* this file should not exist before starting test */ #else -#define FBASENAME1 "sdldata1" /* this file will be created during tests */ -#define FBASENAME2 "sdldata2" /* this file should not exist before starting test */ +#define FBASENAME1 "sdldata1" /* this file will be created during tests */ +#define FBASENAME2 "sdldata2" /* this file should not exist before starting test */ #endif #ifndef NULL @@ -61,7 +61,7 @@ rwops_error_quit(unsigned line, SDL_RWops * rwops) exit(1); /* quit with rwops error (test failed) */ } -#define RWOP_ERR_QUIT(x) rwops_error_quit( __LINE__, (x) ) +#define RWOP_ERR_QUIT(x) rwops_error_quit( __LINE__, (x) ) @@ -92,10 +92,10 @@ main(int argc, char *argv[]) RWOP_ERR_QUIT(rwops); printf("test1 OK\n"); -/* test 2 : check that inexistant file is not successfully opened/created when required */ -/* modes : r, r+ implie that file MUST exist +/* test 2 : check that inexistent file is not successfully opened/created when required */ +/* modes : r, r+ imply that file MUST exist modes : a, a+, w, w+ checks that it succeeds (file may not exists) - + */ rwops = SDL_RWFromFile(FBASENAME2, "rb"); /* this file doesn't exist that call must fail */ if (rwops) @@ -125,8 +125,8 @@ main(int argc, char *argv[]) unlink(FBASENAME2); printf("test2 OK\n"); -/* test 3 : creation, writing , reading, seeking, - test : w mode, r mode, w+ mode +/* test 3 : creation, writing , reading, seeking, + test : w mode, r mode, w+ mode */ rwops = SDL_RWFromFile(FBASENAME1, "wb"); /* write only */ if (!rwops) diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c index 2e9d98ad5..cd18aa5cc 100644 --- a/test/testgamecontroller.c +++ b/test/testgamecontroller.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -105,7 +105,7 @@ WatchGameController(SDL_GameController * gamecontroller) /* Create a window to display controller axis position */ window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, - SCREEN_HEIGHT, SDL_WINDOW_SHOWN); + SCREEN_HEIGHT, 0); if (window == NULL) { fprintf(stderr, "Couldn't create window: %s\n", SDL_GetError()); return; @@ -125,7 +125,7 @@ WatchGameController(SDL_GameController * gamecontroller) /* Print info about the controller we are watching */ printf("Watching controller %s\n", name ? name : "Unknown Controller"); - + /* Loop, getting controller events! */ while (!done) { /* blank screen, set up for drawing this frame. */ @@ -199,7 +199,7 @@ WatchGameController(SDL_GameController * gamecontroller) SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0xFF, SDL_ALPHA_OPAQUE); SDL_RenderPresent(screen); - + if ( !done ) done = SDL_GameControllerGetAttached( gamecontroller ) == 0; } diff --git a/test/testgesture.c b/test/testgesture.c index 53e7e8a55..e2a9694ae 100644 --- a/test/testgesture.c +++ b/test/testgesture.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -93,12 +93,12 @@ void setpix(SDL_Surface *screen, float _x, float _y, unsigned int col) int x = (int)_x; int y = (int)_y; float a; - + if(x < 0 || x >= screen->w) return; if(y < 0 || y >= screen->h) return; pixmem32 = (Uint32*) screen->pixels + y*screen->pitch/BPP + x; - + SDL_memcpy(&colour,pixmem32,screen->format->BytesPerPixel); SDL_GetRGB(colour,screen->format,&r,&g,&b); @@ -110,7 +110,7 @@ void setpix(SDL_Surface *screen, float _x, float _y, unsigned int col) g = (Uint8)(g*(1-a) + ((col>> 8)&0xFF)*(a)); b = (Uint8)(b*(1-a) + ((col>> 0)&0xFF)*(a)); colour = SDL_MapRGB( screen->format,r, g, b); - + *pixmem32 = colour; } @@ -129,7 +129,7 @@ void drawCircle(SDL_Surface* screen,float x,float y,float r,unsigned int c) xr = (float)sqrt(r*r - ty*ty); if(r > 0) { //r > 0 ==> filled circle for(tx=-xr+.5f;tx<=xr-.5;tx++) { - setpix(screen,x+tx,y+ty,c); + setpix(screen,x+tx,y+ty,c); } } else { @@ -140,9 +140,9 @@ void drawCircle(SDL_Surface* screen,float x,float y,float r,unsigned int c) } void drawKnob(SDL_Surface* screen,Knob k) { - drawCircle(screen,k.p.x*screen->w,k.p.y*screen->h,k.r*screen->w,0xFFFFFF); - drawCircle(screen,(k.p.x+k.r/2*cosf(k.ang))*screen->w, - (k.p.y+k.r/2*sinf(k.ang))*screen->h,k.r/4*screen->w,0); + drawCircle(screen,k.p.x*screen->w,k.p.y*screen->h,k.r*screen->w,0xFFFFFF); + drawCircle(screen,(k.p.x+k.r/2*SDL_cosf(k.ang))*screen->w, + (k.p.y+k.r/2*SDL_sinf(k.ang))*screen->h,k.r/4*screen->w,0); } void DrawScreen(SDL_Surface* screen) @@ -154,36 +154,36 @@ void DrawScreen(SDL_Surface* screen) int x, y; for(y = 0;y < screen->h;y++) for(x = 0;x < screen->w;x++) - setpix(screen,(float)x,(float)y,((x%255)<<16) + ((y%255)<<8) + (x+y)%255); + setpix(screen,(float)x,(float)y,((x%255)<<16) + ((y%255)<<8) + (x+y)%255); #endif //draw Touch History for(i = eventWrite; i < eventWrite+EVENT_BUF_SIZE; ++i) { const SDL_Event *event = &events[i&(EVENT_BUF_SIZE-1)]; float age = (float)(i - eventWrite) / EVENT_BUF_SIZE; - float x, y; - unsigned int c, col; + float x, y; + unsigned int c, col; - if(event->type == SDL_FINGERMOTION || + if(event->type == SDL_FINGERMOTION || event->type == SDL_FINGERDOWN || event->type == SDL_FINGERUP) { x = event->tfinger.x; y = event->tfinger.y; - - //draw the touch: - c = colors[event->tfinger.fingerId%7]; + + //draw the touch: + c = colors[event->tfinger.fingerId%7]; col = ((unsigned int)(c*(.1+.85))) | (unsigned int)(0xFF*age)<<24; if(event->type == SDL_FINGERMOTION) - drawCircle(screen,x*screen->w,y*screen->h,5,col); + drawCircle(screen,x*screen->w,y*screen->h,5,col); else if(event->type == SDL_FINGERDOWN) - drawCircle(screen,x*screen->w,y*screen->h,-10,col); + drawCircle(screen,x*screen->w,y*screen->h,-10,col); } } - + if(knob.p.x > 0) drawKnob(screen,knob); - + SDL_UpdateWindowSurface(window); } @@ -201,7 +201,7 @@ SDL_Surface* initScreen(int width,int height) } int main(int argc, char* argv[]) -{ +{ SDL_Surface *screen; SDL_Event event; SDL_bool quitting = SDL_FALSE; @@ -212,7 +212,7 @@ int main(int argc, char* argv[]) knob.ang = 0; if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1; - + if (!(screen = initScreen(WIDTH,HEIGHT))) { SDL_Quit(); @@ -220,92 +220,92 @@ int main(int argc, char* argv[]) } while(!quitting) { - while(SDL_PollEvent(&event)) + while(SDL_PollEvent(&event)) { - //Record _all_ events - events[eventWrite & (EVENT_BUF_SIZE-1)] = event; - eventWrite++; - - switch (event.type) - { - case SDL_QUIT: - quitting = SDL_TRUE; - break; - case SDL_KEYDOWN: - switch (event.key.keysym.sym) - { - case SDLK_SPACE: - SDL_RecordGesture(-1); - break; - case SDLK_s: - src = SDL_RWFromFile("gestureSave","w"); - SDL_Log("Wrote %i templates",SDL_SaveAllDollarTemplates(src)); - SDL_RWclose(src); - break; - case SDLK_l: - src = SDL_RWFromFile("gestureSave","r"); - SDL_Log("Loaded: %i",SDL_LoadDollarTemplates(-1,src)); - SDL_RWclose(src); - break; - case SDLK_ESCAPE: - quitting = SDL_TRUE; - break; - } - break; - case SDL_WINDOWEVENT: + //Record _all_ events + events[eventWrite & (EVENT_BUF_SIZE-1)] = event; + eventWrite++; + + switch (event.type) + { + case SDL_QUIT: + quitting = SDL_TRUE; + break; + case SDL_KEYDOWN: + switch (event.key.keysym.sym) + { + case SDLK_SPACE: + SDL_RecordGesture(-1); + break; + case SDLK_s: + src = SDL_RWFromFile("gestureSave","w"); + SDL_Log("Wrote %i templates",SDL_SaveAllDollarTemplates(src)); + SDL_RWclose(src); + break; + case SDLK_l: + src = SDL_RWFromFile("gestureSave","r"); + SDL_Log("Loaded: %i",SDL_LoadDollarTemplates(-1,src)); + SDL_RWclose(src); + break; + case SDLK_ESCAPE: + quitting = SDL_TRUE; + break; + } + break; + case SDL_WINDOWEVENT: if (event.window.event == SDL_WINDOWEVENT_RESIZED) { - if (!(screen = initScreen(event.window.data1, event.window.data2))) - { - SDL_Quit(); - return 1; - } + if (!(screen = initScreen(event.window.data1, event.window.data2))) + { + SDL_Quit(); + return 1; + } } - break; - case SDL_FINGERMOTION: + break; + case SDL_FINGERMOTION: #if VERBOSE - SDL_Log("Finger: %i,x: %i, y: %i",event.tfinger.fingerId, - event.tfinger.x,event.tfinger.y); + SDL_Log("Finger: %i,x: %i, y: %i",event.tfinger.fingerId, + event.tfinger.x,event.tfinger.y); #endif - break; - case SDL_FINGERDOWN: + break; + case SDL_FINGERDOWN: #if VERBOSE - SDL_Log("Finger: %"PRIs64" down - x: %i, y: %i", - event.tfinger.fingerId,event.tfinger.x,event.tfinger.y); + SDL_Log("Finger: %"PRIs64" down - x: %i, y: %i", + event.tfinger.fingerId,event.tfinger.x,event.tfinger.y); #endif - break; - case SDL_FINGERUP: + break; + case SDL_FINGERUP: #if VERBOSE - SDL_Log("Finger: %"PRIs64" up - x: %i, y: %i", - event.tfinger.fingerId,event.tfinger.x,event.tfinger.y); + SDL_Log("Finger: %"PRIs64" up - x: %i, y: %i", + event.tfinger.fingerId,event.tfinger.x,event.tfinger.y); #endif - break; - case SDL_MULTIGESTURE: -#if VERBOSE - SDL_Log("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f", - event.mgesture.x, - event.mgesture.y, - event.mgesture.dTheta, - event.mgesture.dDist); - SDL_Log("MG: numDownTouch = %i",event.mgesture.numFingers); + break; + case SDL_MULTIGESTURE: +#if VERBOSE + SDL_Log("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f", + event.mgesture.x, + event.mgesture.y, + event.mgesture.dTheta, + event.mgesture.dDist); + SDL_Log("MG: numDownTouch = %i",event.mgesture.numFingers); #endif - knob.p.x = event.mgesture.x; - knob.p.y = event.mgesture.y; - knob.ang += event.mgesture.dTheta; - knob.r += event.mgesture.dDist; - break; - case SDL_DOLLARGESTURE: - SDL_Log("Gesture %"PRIs64" performed, error: %f", - event.dgesture.gestureId, - event.dgesture.error); - break; - case SDL_DOLLARRECORD: - SDL_Log("Recorded gesture: %"PRIs64"",event.dgesture.gestureId); - break; - } + knob.p.x = event.mgesture.x; + knob.p.y = event.mgesture.y; + knob.ang += event.mgesture.dTheta; + knob.r += event.mgesture.dDist; + break; + case SDL_DOLLARGESTURE: + SDL_Log("Gesture %"PRIs64" performed, error: %f", + event.dgesture.gestureId, + event.dgesture.error); + break; + case SDL_DOLLARRECORD: + SDL_Log("Recorded gesture: %"PRIs64"",event.dgesture.gestureId); + break; + } } DrawScreen(screen); - } - SDL_Quit(); + } + SDL_Quit(); return 0; } diff --git a/test/testgl2.c b/test/testgl2.c index f7e408546..eb1a245e3 100644 --- a/test/testgl2.c +++ b/test/testgl2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -195,9 +195,9 @@ main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (consumed == 0) { - if (SDL_strcasecmp(argv[i], "--fsaa") == 0) { - ++fsaa; - consumed = 1; + if (SDL_strcasecmp(argv[i], "--fsaa") == 0 && i+1 < argc) { + fsaa = atoi(argv[i+1]); + consumed = 2; } else if (SDL_strcasecmp(argv[i], "--accel") == 0 && i+1 < argc) { accel = atoi(argv[i+1]); consumed = 2; @@ -206,7 +206,7 @@ main(int argc, char *argv[]) } } if (consumed < 0) { - fprintf(stderr, "Usage: %s %s [--fsaa] [--accel n]\n", argv[0], + fprintf(stderr, "Usage: %s %s [--fsaa n] [--accel n]\n", argv[0], SDLTest_CommonUsage(state)); quit(1); } @@ -255,6 +255,7 @@ main(int argc, char *argv[]) printf("Vendor : %s\n", glGetString(GL_VENDOR)); printf("Renderer : %s\n", glGetString(GL_RENDERER)); printf("Version : %s\n", glGetString(GL_VERSION)); + printf("Extensions : %s\n", glGetString(GL_EXTENSIONS)); printf("\n"); status = SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value); diff --git a/test/testgles.c b/test/testgles.c index 6a4a6deae..41312a8bb 100644 --- a/test/testgles.c +++ b/test/testgles.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testhaptic.c b/test/testhaptic.c index 2a8c2f42c..13dd19d67 100644 --- a/test/testhaptic.c +++ b/test/testhaptic.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -145,7 +145,7 @@ main(int argc, char **argv) /* Now we'll try a SAWTOOTHUP */ if (supported & SDL_HAPTIC_SAWTOOTHUP) { printf(" effect %d: Sawtooth Up\n", nefx); - efx[nefx].type = SDL_HAPTIC_SQUARE; + efx[nefx].type = SDL_HAPTIC_SAWTOOTHUP; efx[nefx].periodic.period = 500; efx[nefx].periodic.magnitude = 0x5000; efx[nefx].periodic.length = 5000; @@ -213,6 +213,22 @@ main(int argc, char **argv) nefx++; } + /* Finally we'll try a left/right effect. */ + if (supported & SDL_HAPTIC_LEFTRIGHT) { + printf(" effect %d: Left/Right\n", nefx); + efx[nefx].type = SDL_HAPTIC_LEFTRIGHT; + efx[nefx].leftright.length = 5000; + efx[nefx].leftright.large_magnitude = 0x3000; + efx[nefx].leftright.small_magnitude = 0xFFFF; + id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); + if (id[nefx] < 0) { + printf("UPLOADING EFFECT ERROR: %s\n", SDL_GetError()); + abort_execution(); + } + nefx++; + } + + printf ("\nNow playing effects for 5 seconds each with 1 second delay between\n"); for (i = 0; i < nefx; i++) { @@ -260,8 +276,9 @@ HapticPrintSupported(SDL_Haptic * haptic) printf(" constant\n"); if (supported & SDL_HAPTIC_SINE) printf(" sine\n"); - if (supported & SDL_HAPTIC_SQUARE) - printf(" square\n"); + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*if (supported & SDL_HAPTIC_SQUARE) + printf(" square\n");*/ if (supported & SDL_HAPTIC_TRIANGLE) printf(" triangle\n"); if (supported & SDL_HAPTIC_SAWTOOTHUP) @@ -280,6 +297,8 @@ HapticPrintSupported(SDL_Haptic * haptic) printf(" intertia\n"); if (supported & SDL_HAPTIC_CUSTOM) printf(" custom\n"); + if (supported & SDL_HAPTIC_LEFTRIGHT) + printf(" left/right\n"); printf(" Supported capabilities:\n"); if (supported & SDL_HAPTIC_GAIN) printf(" gain\n"); diff --git a/test/testiconv.c b/test/testiconv.c index 3da5a6f8a..d2081995d 100644 --- a/test/testiconv.c +++ b/test/testiconv.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -45,7 +45,7 @@ main(int argc, char *argv[]) char buffer[BUFSIZ]; char *ucs4; char *test[2]; - int i, index = 0; + int i; FILE *file; int errors = 0; @@ -84,5 +84,6 @@ main(int argc, char *argv[]) fputs(test[0], stdout); SDL_free(test[0]); } + fclose(file); return (errors ? errors + 1 : 0); } diff --git a/test/testime.c b/test/testime.c index e9a469328..ce9f02b1f 100644 --- a/test/testime.c +++ b/test/testime.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -238,7 +238,7 @@ int main(int argc, char *argv[]) { } } } - + if (!SDLTest_CommonInit(state)) { return 2; } @@ -267,7 +267,7 @@ int main(int argc, char *argv[]) { SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); SDL_RenderClear(renderer); } - Redraw(); + Redraw(); /* Main render loop */ done = 0; while (!done) { @@ -356,7 +356,7 @@ int main(int argc, char *argv[]) { break; } break; - + } } } diff --git a/test/testintersections.c b/test/testintersections.c index e892f8d87..d858717e5 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ #include "SDL_test_common.h" #define SWAP(typ,a,b) do{typ t=a;a=b;b=t;}while(0) -#define NUM_OBJECTS 100 +#define NUM_OBJECTS 100 static SDLTest_CommonState *state; static int num_objects; @@ -98,7 +98,6 @@ void DrawLines(SDL_Renderer * renderer) { int i; - int x1, y1, x2, y2; SDL_Rect viewport; /* Query the sizes */ diff --git a/test/testjoystick.c b/test/testjoystick.c index df94631f1..da307ed29 100644 --- a/test/testjoystick.c +++ b/test/testjoystick.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,11 +21,11 @@ #ifndef SDL_JOYSTICK_DISABLED #ifdef __IPHONEOS__ -#define SCREEN_WIDTH 320 -#define SCREEN_HEIGHT 480 +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 480 #else -#define SCREEN_WIDTH 640 -#define SCREEN_HEIGHT 480 +#define SCREEN_WIDTH 640 +#define SCREEN_HEIGHT 480 #endif @@ -50,7 +50,7 @@ WatchJoystick(SDL_Joystick * joystick) /* Create a window to display joystick axis position */ window = SDL_CreateWindow("Joystick Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, - SCREEN_HEIGHT, SDL_WINDOW_SHOWN); + SCREEN_HEIGHT, 0); if (window == NULL) { fprintf(stderr, "Couldn't create window: %s\n", SDL_GetError()); return SDL_FALSE; diff --git a/test/testkeys.c b/test/testkeys.c index 763ee3b29..71f895602 100644 --- a/test/testkeys.c +++ b/test/testkeys.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testloadso.c b/test/testloadso.c index 8a46bd2cb..4bf7bf654 100644 --- a/test/testloadso.c +++ b/test/testloadso.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -78,5 +78,5 @@ main(int argc, char *argv[]) SDL_UnloadObject(lib); } SDL_Quit(); - return (0); + return retval; } diff --git a/test/testlock.c b/test/testlock.c index 04abf3d7f..fcfeb8bc8 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -10,12 +10,13 @@ freely. */ -/* Test the thread and mutex locking functions +/* Test the thread and mutex locking functions Also exercises the system's signal/thread interaction */ #include #include +#include /* for atexit() */ #include "SDL.h" #include "SDL_mutex.h" diff --git a/test/testmessage.c b/test/testmessage.c index 3a8cf6be0..f76b7ebac 100644 --- a/test/testmessage.c +++ b/test/testmessage.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,17 +29,65 @@ quit(int rc) exit(rc); } +static int +button_messagebox(void *eventNumber) +{ + const SDL_MessageBoxButtonData buttons[] = { + { + SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, + 0, + "OK" + },{ + SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, + 1, + "Cancel" + }, + }; + + SDL_MessageBoxData data = { + SDL_MESSAGEBOX_INFORMATION, + NULL, // no parent window + "Custom MessageBox", + "This is a custom messagebox", + 2, + buttons, + NULL // Default color scheme + }; + + int button = -1; + int success = 0; + if (eventNumber) { + data.message = "This is a custom messagebox from a background thread."; + } + + success = SDL_ShowMessageBox(&data, &button); + if (success == -1) { + printf("Error Presenting MessageBox: %s\n", SDL_GetError()); + if (eventNumber) { + SDL_UserEvent event; + event.type = (intptr_t)eventNumber; + SDL_PushEvent((SDL_Event*)&event); + return 1; + } else { + quit(2); + } + } + printf("Pressed button: %d, %s\n", button, button == 1 ? "Cancel" : "OK"); + + if (eventNumber) { + SDL_UserEvent event; + event.type = (intptr_t)eventNumber; + SDL_PushEvent((SDL_Event*)&event); + } + + return 0; +} + int main(int argc, char *argv[]) { int success; - /* Load the SDL library */ - if (SDL_Init(0) < 0) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); - } - success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Simple MessageBox", "This is a simple error MessageBox", @@ -78,36 +126,56 @@ main(int argc, char *argv[]) quit(1); } + button_messagebox(NULL); + + /* Test showing a message box from a background thread. + + On Mac OS X, the video subsystem needs to be initialized for this + to work, since the message box events are dispatched by the Cocoa + subsystem on the main thread. + */ + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + fprintf(stderr, "Couldn't initialize SDL video subsystem: %s\n", SDL_GetError()); + return (1); + } { - const SDL_MessageBoxButtonData buttons[] = { - { - SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, - 0, - "OK" - },{ - SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, - 1, - "Cancel" - }, - }; + int status = 0; + SDL_Event event; + intptr_t eventNumber = SDL_RegisterEvents(1); + SDL_Thread* thread = SDL_CreateThread(&button_messagebox, "MessageBox", (void*)eventNumber); - SDL_MessageBoxData data = { - SDL_MESSAGEBOX_INFORMATION, - NULL, // no parent window - "Custom MessageBox", - "This is a custom messagebox", - 2, - buttons, - NULL // Default color scheme - }; + while (SDL_WaitEvent(&event)) + { + if (event.type == eventNumber) { + break; + } + } - int button = -1; - success = SDL_ShowMessageBox(&data, &button); + SDL_WaitThread(thread, &status); + + printf("Message box thread return %i\n", status); + } + + /* Test showing a message box with a parent window */ + { + SDL_Event event; + SDL_Window *window = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, 0); + + success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, + "Simple MessageBox", + "This is a simple error MessageBox with a parent window", + window); if (success == -1) { printf("Error Presenting MessageBox: %s\n", SDL_GetError()); - quit(2); + quit(1); + } + + while (SDL_WaitEvent(&event)) + { + if (event.type == SDL_QUIT || event.type == SDL_KEYUP) { + break; + } } - printf("Pressed button: %d, %s\n", button, button == 1 ? "Cancel" : "OK"); } SDL_Quit(); diff --git a/test/testmultiaudio.c b/test/testmultiaudio.c index 049073906..47a95e344 100644 --- a/test/testmultiaudio.c +++ b/test/testmultiaudio.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testnative.c b/test/testnative.c index ec66c18aa..63cba29c3 100644 --- a/test/testnative.c +++ b/test/testnative.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -12,13 +12,15 @@ /* Simple program: Create a native window and attach an SDL renderer */ #include +#include /* for srand() */ +#include /* for time() */ #include "testnative.h" #define WINDOW_W 640 #define WINDOW_H 480 #define NUM_SPRITES 100 -#define MAX_SPEED 1 +#define MAX_SPEED 1 static NativeWindowFactory *factories[] = { #ifdef TEST_NATIVE_WINDOWS @@ -225,6 +227,8 @@ main(int argc, char *argv[]) } quit(0); + + return 0; /* to prevent compiler warning */ } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testnativew32.c b/test/testnativew32.c index c57c4921a..2cb57ddeb 100644 --- a/test/testnativew32.c +++ b/test/testnativew32.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testnativex11.c b/test/testnativex11.c index 74e8b7f0d..9f4150c49 100644 --- a/test/testnativex11.c +++ b/test/testnativex11.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testoverlay2.c b/test/testoverlay2.c index f8d36945f..e071614ad 100644 --- a/test/testoverlay2.c +++ b/test/testoverlay2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -16,15 +16,6 @@ * * ********************************************************************************/ -#if 1 /* FIXME: Rework this using the 2.0 API */ -#include - -int main(int argc, char *argv[]) -{ - printf("FIXME\n"); - return 0; -} -#else #include #include #include @@ -215,135 +206,6 @@ ConvertRGBtoYV12(Uint8 *rgb, Uint8 *out, int w, int h, } } -void -ConvertRGBtoIYUV(SDL_Surface * s, SDL_Overlay * o, int monochrome, - int luminance) -{ - int x, y; - int yuv[3]; - Uint8 *p, *op[3]; - - SDL_LockSurface(s); - SDL_LockYUVOverlay(o); - - /* Convert */ - for (y = 0; y < s->h && y < o->h; y++) { - p = ((Uint8 *) s->pixels) + s->pitch * y; - op[0] = o->pixels[0] + o->pitches[0] * y; - op[1] = o->pixels[1] + o->pitches[1] * (y / 2); - op[2] = o->pixels[2] + o->pitches[2] * (y / 2); - for (x = 0; x < s->w && x < o->w; x++) { - RGBtoYUV(p, yuv, monochrome, luminance); - *(op[0]++) = yuv[0]; - if (x % 2 == 0 && y % 2 == 0) { - *(op[1]++) = yuv[1]; - *(op[2]++) = yuv[2]; - } - p += s->format->BytesPerPixel; - } - } - - SDL_UnlockYUVOverlay(o); - SDL_UnlockSurface(s); -} - -void -ConvertRGBtoUYVY(SDL_Surface * s, SDL_Overlay * o, int monochrome, - int luminance) -{ - int x, y; - int yuv[3]; - Uint8 *p, *op; - - SDL_LockSurface(s); - SDL_LockYUVOverlay(o); - - for (y = 0; y < s->h && y < o->h; y++) { - p = ((Uint8 *) s->pixels) + s->pitch * y; - op = o->pixels[0] + o->pitches[0] * y; - for (x = 0; x < s->w && x < o->w; x++) { - RGBtoYUV(p, yuv, monochrome, luminance); - if (x % 2 == 0) { - *(op++) = yuv[1]; - *(op++) = yuv[0]; - *(op++) = yuv[2]; - } else - *(op++) = yuv[0]; - - p += s->format->BytesPerPixel; - } - } - - SDL_UnlockYUVOverlay(o); - SDL_UnlockSurface(s); -} - -void -ConvertRGBtoYVYU(SDL_Surface * s, SDL_Overlay * o, int monochrome, - int luminance) -{ - int x, y; - int yuv[3]; - Uint8 *p, *op; - - SDL_LockSurface(s); - SDL_LockYUVOverlay(o); - - for (y = 0; y < s->h && y < o->h; y++) { - p = ((Uint8 *) s->pixels) + s->pitch * y; - op = o->pixels[0] + o->pitches[0] * y; - for (x = 0; x < s->w && x < o->w; x++) { - RGBtoYUV(p, yuv, monochrome, luminance); - if (x % 2 == 0) { - *(op++) = yuv[0]; - *(op++) = yuv[2]; - op[1] = yuv[1]; - } else { - *op = yuv[0]; - op += 2; - } - - p += s->format->BytesPerPixel; - } - } - - SDL_UnlockYUVOverlay(o); - SDL_UnlockSurface(s); -} - -void -ConvertRGBtoYUY2(SDL_Surface * s, SDL_Overlay * o, int monochrome, - int luminance) -{ - int x, y; - int yuv[3]; - Uint8 *p, *op; - - SDL_LockSurface(s); - SDL_LockYUVOverlay(o); - - for (y = 0; y < s->h && y < o->h; y++) { - p = ((Uint8 *) s->pixels) + s->pitch * y; - op = o->pixels[0] + o->pitches[0] * y; - for (x = 0; x < s->w && x < o->w; x++) { - RGBtoYUV(p, yuv, monochrome, luminance); - if (x % 2 == 0) { - *(op++) = yuv[0]; - *(op++) = yuv[1]; - op[1] = yuv[2]; - } else { - *op = yuv[0]; - op += 2; - } - - p += s->format->BytesPerPixel; - } - } - - SDL_UnlockYUVOverlay(o); - SDL_UnlockSurface(s); -} - static void PrintUsage(char *argv0) { @@ -384,7 +246,7 @@ main(int argc, char **argv) int scale = 5; SDL_bool done = SDL_FALSE; - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) { + if (SDL_Init(SDL_INIT_VIDEO) < 0) { fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); return 3; } @@ -414,31 +276,6 @@ main(int argc, char **argv) nodelay = 1; argv += 1; argc -= 1; - } else if (strcmp(argv[1], "-format") == 0) { - if (argv[2]) { - if (!strcmp(argv[2], "YV12")) - pixel_format = SDL_PIXELFORMAT_YV12; - else if (!strcmp(argv[2], "IYUV")) - pixel_format = SDL_PIXELFORMAT_IYUV; - else if (!strcmp(argv[2], "YUY2")) - pixel_format = SDL_PIXELFORMAT_YUY2; - else if (!strcmp(argv[2], "UYVY")) - pixel_format = SDL_PIXELFORMAT_UYVY; - else if (!strcmp(argv[2], "YVYU")) - pixel_format = SDL_PIXELFORMAT_YVYU; - else { - fprintf(stderr, - "The -format option %s is not recognized, see help for info.\n", - argv[2]); - quit(10); - } - argv += 2; - argc -= 2; - } else { - fprintf(stderr, - "The -format option requires an argument, default is YUY2.\n"); - quit(10); - } } else if (strcmp(argv[1], "-scale") == 0) { if (argv[2]) { scale = atoi(argv[2]); @@ -496,7 +333,7 @@ main(int argc, char **argv) SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, window_w, window_h, - SDL_WINDOW_SHOWN|SDL_WINDOW_RESIZABLE); + SDL_WINDOW_RESIZABLE); if (!window) { fprintf(stderr, "Couldn't set create window: %s\n", SDL_GetError()); free(RawMooseData); @@ -516,6 +353,8 @@ main(int argc, char **argv) free(RawMooseData); quit(5); } + /* Uncomment this to check vertex color with a YUV texture */ + /*SDL_SetTextureColorMod(MooseTexture, 0xff, 0x80, 0x80);*/ for (i = 0; i < MOOSEFRAMES_COUNT; i++) { Uint8 MooseFrameRGB[MOOSEFRAME_SIZE*3]; @@ -600,6 +439,5 @@ main(int argc, char **argv) quit(0); return 0; } -#endif /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testplatform.c b/test/testplatform.c index 5317b56f9..326b6f7e4 100644 --- a/test/testplatform.c +++ b/test/testplatform.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testpower.c b/test/testpower.c index 031381219..3e13d0ac1 100644 --- a/test/testpower.c +++ b/test/testpower.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -63,7 +63,7 @@ report_power(void) int main(int argc, char *argv[]) { - if (SDL_Init(SDL_INIT_VIDEO) == -1) { + if (SDL_Init(0) == -1) { fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError()); return 1; } diff --git a/test/testrelative.c b/test/testrelative.c index 44ffaf028..fa5bda660 100644 --- a/test/testrelative.c +++ b/test/testrelative.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,7 +35,7 @@ main(int argc, char *argv[]) int i, done; SDL_Event event; - + /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); if (!state) { diff --git a/test/testrendercopyex.c b/test/testrendercopyex.c index dca3ee172..6dd59c0ac 100644 --- a/test/testrendercopyex.c +++ b/test/testrendercopyex.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testrendertarget.c b/test/testrendertarget.c index b7fd11c88..bc3104825 100644 --- a/test/testrendertarget.c +++ b/test/testrendertarget.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -87,6 +87,88 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent) return texture; } +void +DrawComposite(DrawState *s) +{ + SDL_Rect viewport, R; + SDL_Texture *target; + + static SDL_bool blend_tested = SDL_FALSE; + if (!blend_tested) { + SDL_Texture *A, *B; + Uint32 P; + + A = SDL_CreateTexture(s->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, 1, 1); + SDL_SetTextureBlendMode(A, SDL_BLENDMODE_BLEND); + + B = SDL_CreateTexture(s->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, 1, 1); + SDL_SetTextureBlendMode(B, SDL_BLENDMODE_BLEND); + + SDL_SetRenderTarget(s->renderer, A); + SDL_SetRenderDrawColor(s->renderer, 0x00, 0x00, 0x00, 0x80); + SDL_RenderFillRect(s->renderer, NULL); + + SDL_SetRenderTarget(s->renderer, B); + SDL_SetRenderDrawColor(s->renderer, 0x00, 0x00, 0x00, 0x00); + SDL_RenderFillRect(s->renderer, NULL); + SDL_RenderCopy(s->renderer, A, NULL, NULL); + SDL_RenderReadPixels(s->renderer, NULL, SDL_PIXELFORMAT_ARGB8888, &P, sizeof(P)); + + printf("Blended pixel: 0x%8.8X\n", P); + + SDL_DestroyTexture(A); + SDL_DestroyTexture(B); + blend_tested = SDL_TRUE; + } + + SDL_RenderGetViewport(s->renderer, &viewport); + + target = SDL_CreateTexture(s->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, viewport.w, viewport.h); + SDL_SetTextureBlendMode(target, SDL_BLENDMODE_BLEND); + SDL_SetRenderTarget(s->renderer, target); + + /* Draw the background. + This is solid black so when the sprite is copied to it, any per-pixel alpha will be blended through. + */ + SDL_SetRenderDrawColor(s->renderer, 0x00, 0x00, 0x00, 0x00); + SDL_RenderFillRect(s->renderer, NULL); + + /* Scale and draw the sprite */ + s->sprite_rect.w += s->scale_direction; + s->sprite_rect.h += s->scale_direction; + if (s->scale_direction > 0) { + if (s->sprite_rect.w >= viewport.w || s->sprite_rect.h >= viewport.h) { + s->scale_direction = -1; + } + } else { + if (s->sprite_rect.w <= 1 || s->sprite_rect.h <= 1) { + s->scale_direction = 1; + } + } + s->sprite_rect.x = (viewport.w - s->sprite_rect.w) / 2; + s->sprite_rect.y = (viewport.h - s->sprite_rect.h) / 2; + + SDL_RenderCopy(s->renderer, s->sprite, NULL, &s->sprite_rect); + + SDL_SetRenderTarget(s->renderer, NULL); + SDL_RenderCopy(s->renderer, s->background, NULL, NULL); + + SDL_SetRenderDrawBlendMode(s->renderer, SDL_BLENDMODE_BLEND); + SDL_SetRenderDrawColor(s->renderer, 0xff, 0x00, 0x00, 0x80); + R.x = 0; + R.y = 0; + R.w = 100; + R.h = 100; + SDL_RenderFillRect(s->renderer, &R); + SDL_SetRenderDrawBlendMode(s->renderer, SDL_BLENDMODE_NONE); + + SDL_RenderCopy(s->renderer, target, NULL, NULL); + SDL_DestroyTexture(target); + + /* Update the screen! */ + SDL_RenderPresent(s->renderer); +} + void Draw(DrawState *s) { @@ -134,6 +216,7 @@ main(int argc, char *argv[]) SDL_Event event; int frames; Uint32 then, now; + SDL_bool test_composite = SDL_FALSE; /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); @@ -145,8 +228,17 @@ main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (consumed == 0) { - fprintf(stderr, "Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state)); - return 1; + consumed = -1; + if (SDL_strcasecmp(argv[i], "--composite") == 0) { + test_composite = SDL_TRUE; + consumed = 1; + } + } + if (consumed < 0) { + fprintf(stderr, + "Usage: %s %s [--composite]\n", + argv[0], SDLTest_CommonUsage(state)); + quit(1); } i += consumed; } @@ -160,7 +252,11 @@ main(int argc, char *argv[]) drawstate->window = state->windows[i]; drawstate->renderer = state->renderers[i]; - drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", SDL_TRUE); + if (test_composite) { + drawstate->sprite = LoadTexture(drawstate->renderer, "icon-alpha.bmp", SDL_TRUE); + } else { + drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", SDL_TRUE); + } drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", SDL_FALSE); if (!drawstate->sprite || !drawstate->background) { quit(2); @@ -181,7 +277,11 @@ main(int argc, char *argv[]) SDLTest_CommonEvent(state, &event, &done); } for (i = 0; i < state->num_windows; ++i) { - Draw(&drawstates[i]); + if (test_composite) { + DrawComposite(&drawstates[i]); + } else { + Draw(&drawstates[i]); + } } } diff --git a/test/testresample.c b/test/testresample.c index 80733c305..d79f1ac8a 100644 --- a/test/testresample.c +++ b/test/testresample.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,7 +30,7 @@ main(int argc, char **argv) return 1; } - cvtfreq = atoi(argv[3]); + cvtfreq = SDL_atoi(argv[3]); if (SDL_Init(SDL_INIT_AUDIO) == -1) { fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError()); @@ -52,18 +52,18 @@ main(int argc, char **argv) } cvt.len = len; - cvt.buf = (Uint8 *) malloc(len * cvt.len_mult); + cvt.buf = (Uint8 *) SDL_malloc(len * cvt.len_mult); if (cvt.buf == NULL) { fprintf(stderr, "Out of memory.\n"); SDL_FreeWAV(data); SDL_Quit(); return 5; } - memcpy(cvt.buf, data, len); + SDL_memcpy(cvt.buf, data, len); if (SDL_ConvertAudio(&cvt) == -1) { fprintf(stderr, "Conversion failed: %s\n", SDL_GetError()); - free(cvt.buf); + SDL_free(cvt.buf); SDL_FreeWAV(data); SDL_Quit(); return 6; @@ -73,7 +73,7 @@ main(int argc, char **argv) io = SDL_RWFromFile(argv[2], "wb"); if (io == NULL) { fprintf(stderr, "fopen('%s') failed: %s\n", argv[2], SDL_GetError()); - free(cvt.buf); + SDL_free(cvt.buf); SDL_FreeWAV(data); SDL_Quit(); return 7; @@ -100,13 +100,13 @@ main(int argc, char **argv) if (SDL_RWclose(io) == -1) { fprintf(stderr, "fclose('%s') failed: %s\n", argv[2], SDL_GetError()); - free(cvt.buf); + SDL_free(cvt.buf); SDL_FreeWAV(data); SDL_Quit(); return 8; } // if - free(cvt.buf); + SDL_free(cvt.buf); SDL_FreeWAV(data); SDL_Quit(); return 0; diff --git a/test/testrumble.c b/test/testrumble.c index 6efc42c2b..e5b5424d4 100644 --- a/test/testrumble.c +++ b/test/testrumble.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -50,10 +50,6 @@ main(int argc, char **argv) int i; char *name; int index; - SDL_HapticEffect efx[5]; - int id[5]; - int nefx; - unsigned int supported; name = NULL; index = -1; @@ -130,7 +126,7 @@ main(int argc, char **argv) SDL_HapticRumbleStop(haptic); SDL_Delay(2000); printf("Playing 2 second rumble at 0.3 magnitude.\n"); - if (SDL_HapticRumblePlay(haptic, 0.3, 5000) != 0) { + if (SDL_HapticRumblePlay(haptic, 0.3f, 5000) != 0) { printf("\nFailed to play rumble: %s\n", SDL_GetError() ); return 1; } diff --git a/test/testscale.c b/test/testscale.c index 42b21bc5d..0f0096c6e 100644 --- a/test/testscale.c +++ b/test/testscale.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testsem.c b/test/testsem.c index 9d5d027a3..eab280e1d 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -74,7 +74,7 @@ TestWaitTimeout(void) fprintf(stderr, "Wait took %d milliseconds\n", duration); /* Check to make sure the return value indicates timed out */ - if (retval != SDL_MUTEX_TIMEDOUT) + if (retval != SDL_MUTEX_TIMEDOUT) fprintf(stderr, "SDL_SemWaitTimeout returned: %d; expected: %d\n", retval, SDL_MUTEX_TIMEDOUT); } diff --git a/test/testshader.c b/test/testshader.c index 5d3963652..376b445e7 100644 --- a/test/testshader.c +++ b/test/testshader.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -11,15 +11,7 @@ */ /* This is a simple example of using GLSL shaders with SDL */ -#if 1 /* FIXME: Rework this using the 2.0 API */ -#include - -int main(int argc, char *argv[]) -{ - printf("FIXME\n"); - return 0; -} -#else +#include /* for printf() */ #include "SDL.h" #ifdef HAVE_OPENGL @@ -119,7 +111,7 @@ static ShaderData shaders[NUM_SHADERS] = { "}" }, }; - + static PFNGLATTACHOBJECTARBPROC glAttachObjectARB; static PFNGLCOMPILESHADERARBPROC glCompileShaderARB; static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB; @@ -195,7 +187,7 @@ static SDL_bool CompileShaderProgram(ShaderData *data) } } glUseProgramObjectARB(0); - + return (glGetError() == GL_NO_ERROR); } @@ -290,8 +282,7 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord) int w, h; SDL_Surface *image; SDL_Rect area; - Uint32 saved_flags; - Uint8 saved_alpha; + SDL_BlendMode saved_mode; /* Use the surface width and height expanded to powers of 2 */ w = power_of_two(surface->w); @@ -315,11 +306,8 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord) } /* Save the alpha blending attributes */ - saved_flags = surface->flags & (SDL_SRCALPHA | SDL_RLEACCELOK); - SDL_GetSurfaceAlphaMod(surface, &saved_alpha); - if ((saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA) { - SDL_SetAlpha(surface, 0, 0); - } + SDL_GetSurfaceBlendMode(surface, &saved_mode); + SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE); /* Copy the surface into the GL texture image */ area.x = 0; @@ -329,9 +317,7 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord) SDL_BlitSurface(surface, &area, image, &area); /* Restore the alpha blending attributes */ - if ((saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA) { - SDL_SetAlpha(surface, saved_flags, saved_alpha); - } + SDL_SetSurfaceBlendMode(surface, saved_mode); /* Create an OpenGL texture for the image */ glGenTextures(1, &texture); @@ -368,7 +354,7 @@ void InitGL(int Width, int Height) // We call this right afte } /* The main drawing function. */ -void DrawGLScene(GLuint texture, GLfloat * texcoord) +void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat * texcoord) { /* Texture coordinate lookup, to make it simple */ enum { @@ -382,7 +368,7 @@ void DrawGLScene(GLuint texture, GLfloat * texcoord) glLoadIdentity(); // Reset The View glTranslatef(-1.5f,0.0f,0.0f); // Move Left 1.5 Units - + // draw a triangle (in smooth coloring mode) glBegin(GL_POLYGON); // start drawing a polygon glColor3f(1.0f,0.0f,0.0f); // Set The Color To Red @@ -390,8 +376,8 @@ void DrawGLScene(GLuint texture, GLfloat * texcoord) glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right glColor3f(0.0f,0.0f,1.0f); // Set The Color To Blue - glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left - glEnd(); // we're done with the polygon (smooth color interpolation) + glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left + glEnd(); // we're done with the polygon (smooth color interpolation) glTranslatef(3.0f,0.0f,0.0f); // Move Right 3 Units @@ -416,7 +402,7 @@ void DrawGLScene(GLuint texture, GLfloat * texcoord) glTexCoord2f(texcoord[MAXX], texcoord[MAXY]); glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right glTexCoord2f(texcoord[MINX], texcoord[MAXY]); - glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left + glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left glEnd(); // done with the polygon if (shaders_supported) { @@ -425,12 +411,13 @@ void DrawGLScene(GLuint texture, GLfloat * texcoord) glDisable(GL_TEXTURE_2D); // swap buffers to display, since we're double buffered. - SDL_GL_SwapBuffers(); + SDL_GL_SwapWindow(window); } -int main(int argc, char **argv) -{ +int main(int argc, char **argv) +{ int done; + SDL_Window *window; SDL_Surface *surface; GLuint texture; GLfloat texcoords[4]; @@ -442,14 +429,18 @@ int main(int argc, char **argv) } /* Create a 640x480 OpenGL screen */ - if ( SDL_SetVideoMode(640, 480, 0, SDL_OPENGL) == NULL ) { - fprintf(stderr, "Unable to create OpenGL screen: %s\n", SDL_GetError()); + window = SDL_CreateWindow( "Shader Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL ); + if ( !window ) { + fprintf(stderr, "Unable to create OpenGL window: %s\n", SDL_GetError()); SDL_Quit(); exit(2); } - /* Set the title bar in environments that support it */ - SDL_WM_SetCaption("Shader Demo", NULL); + if ( !SDL_GL_CreateContext(window)) { + fprintf(stderr, "Unable to create OpenGL context: %s\n", SDL_GetError()); + SDL_Quit(); + exit(2); + } surface = SDL_LoadBMP("icon.bmp"); if ( ! surface ) { @@ -469,7 +460,7 @@ int main(int argc, char **argv) } done = 0; while ( ! done ) { - DrawGLScene(texture, texcoords); + DrawGLScene(window, texture, texcoords); /* This could go in a separate function */ { SDL_Event event; @@ -503,6 +494,5 @@ main(int argc, char *argv[]) } #endif /* HAVE_OPENGL */ -#endif /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testshape.c b/test/testshape.c index 3afb19406..59dfb9fc2 100644 --- a/test/testshape.c +++ b/test/testshape.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,10 +32,10 @@ void render(SDL_Renderer *renderer,SDL_Texture *texture,SDL_Rect texture_dimensi //Clear render-target to blue. SDL_SetRenderDrawColor(renderer,0x00,0x00,0xff,0xff); SDL_RenderClear(renderer); - + //Render the texture. SDL_RenderCopy(renderer,texture,&texture_dimensions,&texture_dimensions); - + SDL_RenderPresent(renderer); } @@ -72,14 +72,14 @@ int main(int argc,char** argv) printf("SDL_Shape requires at least one bitmap file as argument.\n"); exit(-1); } - + if(SDL_VideoInit(NULL) == -1) { printf("Could not initialize SDL video.\n"); exit(-2); } - + num_pictures = argc - 1; - pictures = (LoadedPicture *)malloc(sizeof(LoadedPicture)*num_pictures); + pictures = (LoadedPicture *)SDL_malloc(sizeof(LoadedPicture)*num_pictures); for(i=0;i + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -15,6 +15,7 @@ #include #include +#include "SDL_test.h" #include "SDL_test_common.h" #define NUM_SPRITES 100 @@ -33,6 +34,10 @@ static SDL_Rect *velocities; static int sprite_w, sprite_h; static SDL_BlendMode blendMode = SDL_BLENDMODE_BLEND; +/* Number of iterations to move sprites - used for visual tests. */ +/* -1: infinite random moves (default); >=0: enables N deterministic moves */ +static int iterations = -1; + /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -51,7 +56,7 @@ quit(int rc) } int -LoadSprite(char *file) +LoadSprite(const char *file) { int i; SDL_Surface *temp; @@ -105,7 +110,7 @@ LoadSprite(char *file) void MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) { - int i, n; + int i; SDL_Rect viewport, temp; SDL_Rect *position, *velocity; @@ -191,22 +196,38 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) SDL_RenderDrawLine(renderer, viewport.w-sprite_w-2, sprite_h, sprite_w, viewport.h-sprite_h-2); - /* Move the sprite, bounce at the wall, and draw */ - n = 0; + /* Conditionally move the sprites, bounce at the wall */ + if (iterations == -1 || iterations > 0) { + for (i = 0; i < num_sprites; ++i) { + position = &positions[i]; + velocity = &velocities[i]; + position->x += velocity->x; + if ((position->x < 0) || (position->x >= (viewport.w - sprite_w))) { + velocity->x = -velocity->x; + position->x += velocity->x; + } + position->y += velocity->y; + if ((position->y < 0) || (position->y >= (viewport.h - sprite_h))) { + velocity->y = -velocity->y; + position->y += velocity->y; + } + + } + + /* Countdown sprite-move iterations and disable color changes at iteration end - used for visual tests. */ + if (iterations > 0) { + iterations--; + if (iterations == 0) { + cycle_alpha = SDL_FALSE; + cycle_color = SDL_FALSE; + } + } + } + + /* Draw sprites */ for (i = 0; i < num_sprites; ++i) { position = &positions[i]; - velocity = &velocities[i]; - position->x += velocity->x; - if ((position->x < 0) || (position->x >= (viewport.w - sprite_w))) { - velocity->x = -velocity->x; - position->x += velocity->x; - } - position->y += velocity->y; - if ((position->y < 0) || (position->y >= (viewport.h - sprite_h))) { - velocity->y = -velocity->y; - position->y += velocity->y; - } - + /* Blit the sprite onto the screen */ SDL_RenderCopy(renderer, sprite, NULL, position); } @@ -221,6 +242,8 @@ main(int argc, char *argv[]) int i, done; SDL_Event event; Uint32 then, now, frames; + Uint64 seed; + const char *icon = "icon.bmp"; /* Initialize parameters */ num_sprites = NUM_SPRITES; @@ -255,6 +278,12 @@ main(int argc, char *argv[]) consumed = 2; } } + } else if (SDL_strcasecmp(argv[i], "--iterations") == 0) { + if (argv[i + 1]) { + iterations = SDL_atoi(argv[i + 1]); + if (iterations < -1) iterations = -1; + consumed = 2; + } } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) { cycle_color = SDL_TRUE; consumed = 1; @@ -264,11 +293,14 @@ main(int argc, char *argv[]) } else if (SDL_isdigit(*argv[i])) { num_sprites = SDL_atoi(argv[i]); consumed = 1; + } else if (argv[i][0] != '-') { + icon = argv[i]; + consumed = 1; } } if (consumed < 0) { fprintf(stderr, - "Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n", + "Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha] [--iterations N] [num_sprites] [icon.bmp]\n", argv[0], SDLTest_CommonUsage(state)); quit(1); } @@ -290,7 +322,7 @@ main(int argc, char *argv[]) SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); SDL_RenderClear(renderer); } - if (LoadSprite("icon.bmp") < 0) { + if (LoadSprite(icon) < 0) { quit(2); } @@ -301,17 +333,26 @@ main(int argc, char *argv[]) fprintf(stderr, "Out of memory!\n"); quit(2); } - srand((unsigned int)time(NULL)); + + /* Position sprites and set their velocities using the fuzzer */ + if (iterations >= 0) { + /* Deterministic seed - used for visual tests */ + seed = (Uint64)iterations; + } else { + /* Pseudo-random seed generated from the time */ + seed = (Uint64)time(NULL); + } + SDLTest_FuzzerInit(seed); for (i = 0; i < num_sprites; ++i) { - positions[i].x = rand() % (state->window_w - sprite_w); - positions[i].y = rand() % (state->window_h - sprite_h); + positions[i].x = SDLTest_RandomIntegerInRange(0, state->window_w - sprite_w); + positions[i].y = SDLTest_RandomIntegerInRange(0, state->window_h - sprite_h); positions[i].w = sprite_w; positions[i].h = sprite_h; velocities[i].x = 0; velocities[i].y = 0; while (!velocities[i].x && !velocities[i].y) { - velocities[i].x = (rand() % (MAX_SPEED * 2 + 1)) - MAX_SPEED; - velocities[i].y = (rand() % (MAX_SPEED * 2 + 1)) - MAX_SPEED; + velocities[i].x = SDLTest_RandomIntegerInRange(-MAX_SPEED, MAX_SPEED); + velocities[i].y = SDLTest_RandomIntegerInRange(-MAX_SPEED, MAX_SPEED); } } diff --git a/test/testspriteminimal.c b/test/testspriteminimal.c index 76244c282..6f3ac25c0 100644 --- a/test/testspriteminimal.c +++ b/test/testspriteminimal.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -84,7 +84,7 @@ LoadSprite(char *file, SDL_Renderer *renderer) } void -MoveSprites(SDL_Window * window, SDL_Renderer * renderer, SDL_Texture * sprite) +MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) { int i; int window_w = WINDOW_WIDTH; @@ -158,10 +158,12 @@ main(int argc, char *argv[]) done = 1; } } - MoveSprites(window, renderer, sprite); + MoveSprites(renderer, sprite); } quit(0); + + return 0; /* to prevent compiler warning */ } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/teststreaming.c b/test/teststreaming.c index 3e70a5742..ea3ac2d61 100644 --- a/test/teststreaming.c +++ b/test/teststreaming.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -113,7 +113,7 @@ main(int argc, char **argv) SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, MOOSEPIC_W*4, MOOSEPIC_H*4, - SDL_WINDOW_SHOWN|SDL_WINDOW_RESIZABLE); + SDL_WINDOW_RESIZABLE); if (!window) { fprintf(stderr, "Couldn't set create window: %s\n", SDL_GetError()); quit(3); diff --git a/test/testthread.c b/test/testthread.c index 3deab1613..949e44e3a 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,6 +19,7 @@ #include "SDL.h" #include "SDL_thread.h" +static SDL_TLSID tls; static int alive = 0; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ @@ -32,20 +33,21 @@ quit(int rc) int SDLCALL ThreadFunc(void *data) { - SDL_Log("Started thread %s: My thread id is %lu\n", - (char *) data, SDL_ThreadID()); + SDL_TLSSet(tls, "baby thread", NULL); + printf("Started thread %s: My thread id is %lu, thread data = %s\n", + (char *) data, SDL_ThreadID(), (const char *)SDL_TLSGet(tls)); while (alive) { - SDL_Log("Thread '%s' is alive!\n", (char *) data); + printf("Thread '%s' is alive!\n", (char *) data); SDL_Delay(1 * 1000); } - SDL_Log("Thread '%s' exiting!\n", (char *) data); + printf("Thread '%s' exiting!\n", (char *) data); return (0); } static void killed(int sig) { - SDL_Log("Killed with SIGTERM, waiting 5 seconds to exit\n"); + printf("Killed with SIGTERM, waiting 5 seconds to exit\n"); SDL_Delay(5 * 1000); alive = 0; quit(0); @@ -58,26 +60,33 @@ main(int argc, char *argv[]) /* Load the SDL library */ if (SDL_Init(0) < 0) { - SDL_LogError(SDL_LOG_CATEGORY_ERROR, "Couldn't initialize SDL: %s\n", SDL_GetError()); + fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); return (1); } + tls = SDL_TLSCreate(); + SDL_assert(tls); + SDL_TLSSet(tls, "main thread", NULL); + printf("Main thread data initially: %s\n", (const char *)SDL_TLSGet(tls)); + alive = 1; thread = SDL_CreateThread(ThreadFunc, "One", "#1"); if (thread == NULL) { - SDL_LogError(SDL_LOG_CATEGORY_ERROR, "Couldn't create thread: %s\n", SDL_GetError()); + fprintf(stderr, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } SDL_Delay(5 * 1000); - SDL_Log("Waiting for thread #1\n"); + printf("Waiting for thread #1\n"); alive = 0; SDL_WaitThread(thread, NULL); + printf("Main thread data finally: %s\n", (const char *)SDL_TLSGet(tls)); + alive = 1; signal(SIGTERM, killed); thread = SDL_CreateThread(ThreadFunc, "Two", "#2"); if (thread == NULL) { - SDL_LogError(SDL_LOG_CATEGORY_ERROR, "Couldn't create thread: %s\n", SDL_GetError()); + fprintf(stderr, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } raise(SIGTERM); diff --git a/test/testtimer.c b/test/testtimer.c index 13d94490d..ebc655d10 100644 --- a/test/testtimer.c +++ b/test/testtimer.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -14,26 +14,17 @@ platform */ -#if 1 /* FIXME: Rework this using the 2.0 API */ -#include - -int main(int argc, char *argv[]) -{ - printf("FIXME\n"); - return 0; -} -#else #include #include #include "SDL.h" -#define DEFAULT_RESOLUTION 1 +#define DEFAULT_RESOLUTION 1 static int ticks = 0; static Uint32 SDLCALL -ticktock(Uint32 interval) +ticktock(Uint32 interval, void *param) { ++ticks; return (interval); @@ -51,6 +42,7 @@ main(int argc, char *argv[]) { int i, desired; SDL_TimerID t1, t2, t3; + Uint32 start32, now32; Uint64 start, now; if (SDL_Init(SDL_INIT_TIMER) < 0) { @@ -66,14 +58,14 @@ main(int argc, char *argv[]) if (desired == 0) { desired = DEFAULT_RESOLUTION; } - SDL_SetTimer(desired, ticktock); + t1 = SDL_AddTimer(desired, ticktock, NULL); /* Wait 10 seconds */ printf("Waiting 10 seconds\n"); SDL_Delay(10 * 1000); /* Stop the timer */ - SDL_SetTimer(0, NULL); + SDL_RemoveTimer(t1); /* Print the results */ if (ticks) { @@ -108,14 +100,21 @@ main(int argc, char *argv[]) start = SDL_GetPerformanceCounter(); for (i = 0; i < 1000000; ++i) { - ticktock(0); + ticktock(0, NULL); } now = SDL_GetPerformanceCounter(); printf("1 million iterations of ticktock took %f ms\n", (double)((now - start)*1000) / SDL_GetPerformanceFrequency()); + printf("Performance counter frequency: %llu\n", (unsigned long long) SDL_GetPerformanceFrequency()); + start32 = SDL_GetTicks(); + start = SDL_GetPerformanceCounter(); + SDL_Delay(1000); + now = SDL_GetPerformanceCounter(); + now32 = SDL_GetTicks(); + printf("Delay 1 second = %d ms in ticks, %f ms according to performance counter\n", (now32-start32), (double)((now - start)*1000) / SDL_GetPerformanceFrequency()); + SDL_Quit(); return (0); } -#endif /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testver.c b/test/testver.c index 7f2a52b95..ecfcdf35e 100644 --- a/test/testver.c +++ b/test/testver.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testwm2.c b/test/testwm2.c index bdc484ec3..efe6ea4dd 100644 --- a/test/testwm2.c +++ b/test/testwm2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -129,8 +129,8 @@ main(int argc, char *argv[]) SDL_FreeCursor(cursor); quit(0); - // keep the compiler happy ... - return(0); + // keep the compiler happy ... + return(0); } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/torturethread.c b/test/torturethread.c index fb003d499..795b60b93 100644 --- a/test/torturethread.c +++ b/test/torturethread.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2013 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages